<?php ob_start ("ob_gzhandler");header("Content-type: text/javascript; charset: UTF-8"); ?>Ext={};window["undefined"]=window["undefined"];Ext.apply=function(C,D,A){if(A){Ext.apply(C,A)}if(C&&D&&typeof D=="object"){for(var B in D){C[B]=D[B]}}return C};(function(){var _5=0;var ua=navigator.userAgent.toLowerCase();var _7=document.compatMode=="CSS1Compat",_8=ua.indexOf("opera")>-1,_9=(/webkit|khtml/).test(ua),_a=ua.indexOf("msie")>-1,_b=ua.indexOf("msie 7")>-1,_c=!_9&&ua.indexOf("gecko")>-1,_d=_a&&!_7,_e=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),_f=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),_10=(ua.indexOf("linux")!=-1),_11=window.location.href.toLowerCase().indexOf("https")===0;if(_a&&!_b){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:_7,isSecure:_11,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return }var _16={};for(var b in o){var _18=b.split("@");if(_18[1]){var s=_18[0];if(!_16[s]){_16[s]=Ext.select(s)}_16[s].on(_18[1],o[b])}}_16=null},id:function(el,_1b){_1b=_1b||"ext-gen";el=Ext.getDom(el);var id=_1b+(++_5);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};return function(sb,sp,_22){if(typeof sp=="object"){_22=sp;sp=sb;sb=function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,_22);return sb}}(),override:function(_27,_28){if(_28){var p=_27.prototype;for(var _2a in _28){p[_2a]=_28[_2a]}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+' == "undefined"){'+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key];var _35=typeof ov;if(_35=="undefined"){buf.push(encodeURIComponent(key),"=&")}else{if(_35!="function"&&_35!="object"){buf.push(encodeURIComponent(key),"=",encodeURIComponent(ov),"&")}else{if(ov instanceof Array){for(var i=0,len=ov.length;i<len;i++){buf.push(encodeURIComponent(key),"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}}}}buf.pop();return buf.join("")},urlDecode:function(_38,_39){if(!_38||!_38.length){return{}}var obj={};var _3b=_38.split("&");var _3c,_3d,_3e;for(var i=0,len=_3b.length;i<len;i++){_3c=_3b[i].split("=");_3d=decodeURIComponent(_3c[0]);_3e=decodeURIComponent(_3c[1]);if(_39!==true){if(typeof obj[_3d]=="undefined"){obj[_3d]=_3e}else{if(typeof obj[_3d]=="string"){obj[_3d]=[obj[_3d]];obj[_3d].push(_3e)}else{obj[_3d].push(_3e)}}}else{obj[_3d]=_3e}}return obj},each:function(_41,fn,_43){if(typeof _41.length=="undefined"||typeof _41=="string"){_41=[_41]}for(var i=0,len=_41.length;i<len;i++){if(fn.call(_43||_41[i],_41[i],i,_41)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,_4d,_4e,_4f){if(typeof cb=="function"){if(_4f){cb.defer(_4f,_4d,_4e||[])}else{cb.apply(_4d,_4e||[])}}},getDom:function(el){if(!el){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,_53){if(typeof v!="number"){return _53}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue}if(typeof as.purgeListeners=="function"){as.purgeListeners()}if(typeof as.destroy=="function"){as.destroy()}}}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,_5b){return v===null||v===undefined||(!_5b?v==="":false)},isOpera:_8,isSafari:_9,isIE:_a,isIE7:_b,isGecko:_c,isBorderBox:_d,isWindows:_e,isLinux:_10,isMac:_f,useShims:((_a&&!_b)||(_c&&_f))})})();Ext.namespace("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var A=arguments;var B=this;return function(){return B.apply(window,A)}},createDelegate:function(C,B,D){var A=this;return function(){var F=B||arguments;if(D===true){F=Array.prototype.slice.call(arguments,0);F=F.concat(B)}else{if(typeof D=="number"){F=Array.prototype.slice.call(arguments,0);var E=[D,0].concat(B);Array.prototype.splice.apply(F,E)}}return A.apply(C||window,F)}},defer:function(D,E,B,A){var C=this.createDelegate(E,B,A);if(D){return setTimeout(C,D)}C();return 0},createSequence:function(C,B){if(typeof C!="function"){return this}var A=this;return function(){var D=A.apply(this||window,arguments);C.apply(B||this||window,arguments);return D}},createInterceptor:function(B,A){if(typeof B!="function"){return this}var C=this;return function(){B.target=this;B.method=C;if(B.apply(A||this||window,arguments)===false){return }return C.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1")},leftPad:function(D,C,A){var B=new String(D);if(A===null||A===undefined||A===""){A=" "}while(B.length<C){B=A+B}return B},format:function(B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})}});String.prototype.toggle=function(A,B){return this==A?B:A};Ext.applyIf(Number.prototype,{constrain:function(B,A){return Math.min(Math.max(this,B),A)}});Ext.applyIf(Array.prototype,{indexOf:function(C){for(var B=0,A=this.length;B<A;B++){if(this[B]==C){return B}}return -1},remove:function(B){var A=this.indexOf(B);if(A!=-1){this.splice(A,1)}}});Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime())};(function(){var D;Ext.lib.Dom={getViewWidth:function(E){return E?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(E){return E?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var E=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(E,this.getViewportHeight())},getDocumentWidth:function(){var E=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(E,this.getViewportWidth())},getViewportHeight:function(){var F=self.innerHeight;var E=document.compatMode;if((E||Ext.isIE)&&!Ext.isOpera){F=(E=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return F},getViewportWidth:function(){var F=self.innerWidth;var E=document.compatMode;if(E||Ext.isIE){F=(E=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return F},isAncestor:function(F,G){F=Ext.getDom(F);G=Ext.getDom(G);if(!F||!G){return false}if(F.contains&&!Ext.isSafari){return F.contains(G)}else{if(F.compareDocumentPosition){return !!(F.compareDocumentPosition(G)&16)}else{var E=G.parentNode;while(E){if(E==F){return true}else{if(!E.tagName||E.tagName.toUpperCase()=="HTML"){return false}}E=E.parentNode}return false}}},getRegion:function(E){return Ext.lib.Region.getRegion(E)},getY:function(E){return this.getXY(E)[1]},getX:function(E){return this.getXY(E)[0]},getXY:function(G){var E,L,N,J,K=document.body;G=Ext.getDom(G);if(G.getBoundingClientRect){N=G.getBoundingClientRect();J=B(document).getScroll();return[N.left+J.left,N.top+J.top]}var O=0,M=0;E=G;var F=B(G).getStyle("position")=="absolute";while(E){O+=E.offsetLeft;M+=E.offsetTop;if(!F&&B(E).getStyle("position")=="absolute"){F=true}if(Ext.isGecko){L=B(E);var P=parseInt(L.getStyle("borderTopWidth"),10)||0;var H=parseInt(L.getStyle("borderLeftWidth"),10)||0;O+=H;M+=P;if(E!=G&&L.getStyle("overflow")!="visible"){O+=H;M+=P}}E=E.offsetParent}if(Ext.isSafari&&F){O-=K.offsetLeft;M-=K.offsetTop}if(Ext.isGecko&&!F){var I=B(K);O+=parseInt(I.getStyle("borderLeftWidth"),10)||0;M+=parseInt(I.getStyle("borderTopWidth"),10)||0}E=G.parentNode;while(E&&E!=K){if(!(Ext.isOpera&&E.tagName!="TR"&&B(E).getStyle("display")!="inline")){O-=E.scrollLeft;M-=E.scrollTop}E=E.parentNode}return[O,M]},setXY:function(E,F){E=Ext.fly(E,"_setXY");E.position();var G=E.translatePoints(F);if(F[0]!==false){E.dom.style.left=G.left+"px"}if(F[1]!==false){E.dom.style.top=G.top+"px"}},setX:function(F,E){this.setXY(F,[E,false])},setY:function(E,F){this.setXY(E,[false,F])}};Ext.lib.Event=function(){var K=false;var J=[];var I=[];var H=0;var G=[];var F=0;var E=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var M=this;var L=function(){M._tryPreloadAttach()};this._interval=setInterval(L,this.POLL_INTERVAL)}},onAvailable:function(O,N,M,L){G.push({id:O,fn:N,obj:M,override:L,checkReady:false});H=this.POLL_RETRYS;this.startInterval()},addListener:function(P,N,O){P=Ext.getDom(P);if(!P||!O){return false}if("unload"==N){I[I.length]=[P,N,O];return true}var M=function(R){return O(Ext.lib.Event.getEvent(R))};var L=[P,N,O,M];var Q=J.length;J[Q]=L;this.doAdd(P,N,M,false);return true},removeListener:function(Q,S,P){var N,M;Q=Ext.getDom(Q);if(!P){return this.purgeElement(Q,false,S)}if("unload"==S){for(N=0,M=I.length;N<M;N++){var L=I[N];if(L&&L[0]==Q&&L[1]==S&&L[2]==P){I.splice(N,1);return true}}return false}var R=null;var O=arguments[3];if("undefined"==typeof O){O=this._getCacheIndex(Q,S,P)}if(O>=0){R=J[O]}if(!Q||!R){return false}this.doRemove(Q,S,R[this.WFN],false);delete J[O][this.WFN];delete J[O][this.FN];J.splice(O,1);return true},getTarget:function(N,M){N=N.browserEvent||N;var L=N.target||N.srcElement;return this.resolveTextNode(L)},resolveTextNode:function(L){if(Ext.isSafari&&L&&3==L.nodeType){return L.parentNode}else{return L}},getPageX:function(M){M=M.browserEvent||M;var L=M.pageX;if(!L&&0!==L){L=M.clientX||0;if(Ext.isIE){L+=this.getScroll()[1]}}return L},getPageY:function(L){L=L.browserEvent||L;var M=L.pageY;if(!M&&0!==M){M=L.clientY||0;if(Ext.isIE){M+=this.getScroll()[0]}}return M},getXY:function(L){L=L.browserEvent||L;return[this.getPageX(L),this.getPageY(L)]},getRelatedTarget:function(M){M=M.browserEvent||M;var L=M.relatedTarget;if(!L){if(M.type=="mouseout"){L=M.toElement}else{if(M.type=="mouseover"){L=M.fromElement}}}return this.resolveTextNode(L)},getTime:function(N){N=N.browserEvent||N;if(!N.time){var M=new Date().getTime();try{N.time=M}catch(L){this.lastError=L;return M}}return N.time},stopEvent:function(L){this.stopPropagation(L);this.preventDefault(L)},stopPropagation:function(L){L=L.browserEvent||L;if(L.stopPropagation){L.stopPropagation()}else{L.cancelBubble=true}},preventDefault:function(L){L=L.browserEvent||L;if(L.preventDefault){L.preventDefault()}else{L.returnValue=false}},getEvent:function(M){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break}N=N.caller}}return L},getCharCode:function(L){L=L.browserEvent||L;return L.charCode||L.keyCode||0},_getCacheIndex:function(Q,N,P){for(var O=0,M=J.length;O<M;++O){var L=J[O];if(L&&L[this.FN]==P&&L[this.EL]==Q&&L[this.TYPE]==N){return O}}return -1},elCache:{},getEl:function(L){return document.getElementById(L)},clearCache:function(){},_load:function(M){K=true;var L=Ext.lib.Event;if(Ext.isIE){L.doRemove(window,"load",L._load)}},_tryPreloadAttach:function(){if(this.locked){return false}this.locked=true;var M=!K;if(!M){M=(H>0)}var R=[];for(var N=0,L=G.length;N<L;++N){var Q=G[N];if(Q){var O=this.getEl(Q.id);if(O){if(!Q.checkReady||K||O.nextSibling||(document&&document.body)){var P=O;if(Q.override){if(Q.override===true){P=Q.obj}else{P=Q.override}}Q.fn.call(P,Q.obj);G[N]=null}}else{R.push(Q)}}}H=(R.length===0)?0:H-1;if(M){this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false;return true},purgeElement:function(R,Q,P){var N=this.getListeners(R,P);if(N){for(var O=0,L=N.length;O<L;++O){var M=N[O];this.removeListener(R,M.type,M.fn)}}if(Q&&R&&R.childNodes){for(O=0,L=R.childNodes.length;O<L;++O){this.purgeElement(R.childNodes[O],Q,P)}}},getListeners:function(L,T){var R=[],Q;if(!T){Q=[J,I]}else{if(T=="unload"){Q=[I]}else{Q=[J]}}for(var N=0;N<Q.length;++N){var O=Q[N];if(O&&O.length>0){for(var P=0,S=O.length;P<S;++P){var M=O[P];if(M&&M[this.EL]===L&&(!T||T===M[this.TYPE])){R.push({type:M[this.TYPE],fn:M[this.FN],obj:M[this.OBJ],adjust:M[this.ADJ_SCOPE],index:P})}}}}return(R.length)?R:null},_unload:function(S){var R=Ext.lib.Event,P,O,M,L,N;for(P=0,L=I.length;P<L;++P){M=I[P];if(M){var Q=window;if(M[R.ADJ_SCOPE]){if(M[R.ADJ_SCOPE]===true){Q=M[R.OBJ]}else{Q=M[R.ADJ_SCOPE]}}M[R.FN].call(Q,R.getEvent(S),M[R.OBJ]);I[P]=null;M=null;Q=null}}I=null;if(J&&J.length>0){O=J.length;while(O){N=O-1;M=J[N];if(M){R.removeListener(M[R.EL],M[R.TYPE],M[R.FN],N)}O=O-1}M=null;R.clearCache()}R.doRemove(window,"unload",R._unload)},getScroll:function(){var L=document.documentElement,M=document.body;if(L&&(L.scrollTop||L.scrollLeft)){return[L.scrollTop,L.scrollLeft]}else{if(M){return[M.scrollTop,M.scrollLeft]}else{return[0,0]}}},doAdd:function(){if(window.addEventListener){return function(O,M,N,L){O.addEventListener(M,N,(L))}}else{if(window.attachEvent){return function(N,L,M,O){N.attachEvent("on"+L,M)}}else{return function(){}}}}(),doRemove:function(){if(window.removeEventListener){return function(N,O,M,L){N.removeEventListener(O,M,(L))}}else{if(window.detachEvent){return function(M,N,L){M.detachEvent("on"+N,L)}}else{return function(){}}}}()}}();var C=Ext.lib.Event;C.on=C.addListener;C.un=C.removeListener;if(document&&document.body){C._load()}else{C.doAdd(window,"load",C._load)}C.doAdd(window,"unload",C._unload);C._tryPreloadAttach();Ext.lib.Ajax={request:function(J,K,E,H,F){if(F){var G=F.headers;if(G){for(var I in G){if(G.hasOwnProperty(I)){this.initHeader(I,G[I],false)}}}if(F.xmlData){this.initHeader("Content-Type","text/xml",false);J="POST";H=F.xmlData}}return this.asyncRequest(J,K,E,H)},serializeForm:function(L){if(typeof L=="string"){L=(document.getElementById(L)||document.forms[L])}var E,K,F,I,G="",M=false;for(var J=0;J<L.elements.length;J++){E=L.elements[J];I=L.elements[J].disabled;K=L.elements[J].name;F=L.elements[J].value;if(!I&&K){switch(E.type){case"select-one":case"select-multiple":for(var H=0;H<E.options.length;H++){if(E.options[H].selected){if(Ext.isIE){G+=encodeURIComponent(K)+"="+encodeURIComponent(E.options[H].attributes["value"].specified?E.options[H].value:E.options[H].text)+"&"}else{G+=encodeURIComponent(K)+"="+encodeURIComponent(E.options[H].hasAttribute("value")?E.options[H].value:E.options[H].text)+"&"}}}break;case"radio":case"checkbox":if(E.checked){G+=encodeURIComponent(K)+"="+encodeURIComponent(F)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(M==false){G+=encodeURIComponent(K)+"="+encodeURIComponent(F)+"&";M=true}break;default:G+=encodeURIComponent(K)+"="+encodeURIComponent(F)+"&";break}}}G=G.substr(0,G.length-1);return G},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(E){this.activeX.unshift(E)},setDefaultPostHeader:function(E){this.useDefaultHeader=E},setDefaultXhrHeader:function(E){this.useDefaultXhrHeader=E},setPollingInterval:function(E){if(typeof E=="number"&&isFinite(E)){this.pollInterval=E}},createXhrObject:function(G){var I,F;try{F=new XMLHttpRequest();I={conn:F,tId:G}}catch(H){for(var E=0;E<this.activeX.length;++E){try{F=new ActiveXObject(this.activeX[E]);I={conn:F,tId:G};break}catch(H){}}}finally{return I}},getConnectionObject:function(){var F;var G=this.transactionId;try{F=this.createXhrObject(G);if(F){this.transactionId++}}catch(E){}finally{return F}},asyncRequest:function(E,G,I,F){var H=this.getConnectionObject();if(!H){return null}else{H.conn.open(E,G,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true)}}if(F&&this.useDefaultHeader){this.initHeader("Content-Type",this.defaultPostHeader)}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(H)}this.handleReadyState(H,I);H.conn.send(F||null);return H}},handleReadyState:function(F,G){var E=this;if(G&&G.timeout){this.timeout[F.tId]=window.setTimeout(function(){E.abort(F,G,true)},G.timeout)}this.poll[F.tId]=window.setInterval(function(){if(F.conn&&F.conn.readyState==4){window.clearInterval(E.poll[F.tId]);delete E.poll[F.tId];if(G&&G.timeout){window.clearTimeout(E.timeout[F.tId]);delete E.timeout[F.tId]}E.handleTransactionResponse(F,G)}},this.pollInterval)},handleTransactionResponse:function(J,I,H){if(!I){this.releaseObject(J);return }var F,E;try{if(J.conn.status!==undefined&&J.conn.status!=0){F=J.conn.status}else{F=13030}}catch(G){F=13030}if(F>=200&&F<300){E=this.createResponseObject(J,I.argument);if(I.success){if(!I.scope){I.success(E)}else{I.success.apply(I.scope,[E])}}}else{switch(F){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:E=this.createExceptionObject(J.tId,I.argument,(H?H:false));if(I.failure){if(!I.scope){I.failure(E)}else{I.failure.apply(I.scope,[E])}}break;default:E=this.createResponseObject(J,I.argument);if(I.failure){if(!I.scope){I.failure(E)}else{I.failure.apply(I.scope,[E])}}}}this.releaseObject(J);E=null},createResponseObject:function(G,I){var K={};var H={};try{var F=G.conn.getAllResponseHeaders();var E=F.split("\n");for(var L=0;L<E.length;L++){var J=E[L].indexOf(":");if(J!=-1){H[E[L].substring(0,J)]=E[L].substring(J+2)}}}catch(M){}K.tId=G.tId;K.status=G.conn.status;K.statusText=G.conn.statusText;K.getResponseHeader=H;K.getAllResponseHeaders=F;K.responseText=G.conn.responseText;K.responseXML=G.conn.responseXML;if(typeof I!==undefined){K.argument=I}return K},createExceptionObject:function(L,G,F){var K=0;var E="communication failure";var J=-1;var I="transaction aborted";var H={};H.tId=L;if(F){H.status=J;H.statusText=I}else{H.status=K;H.statusText=E}if(G){H.argument=G}return H},initHeader:function(H,G,F){var E=(F)?this.defaultHeaders:this.headers;if(E[H]===undefined){E[H]=G}else{E[H]=G+","+E[H]}if(F){this.hasDefaultHeaders=true}else{this.hasHeaders=true}},setHeader:function(F){if(this.hasDefaultHeaders){for(var E in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(E)){F.conn.setRequestHeader(E,this.defaultHeaders[E])}}}if(this.hasHeaders){for(var E in this.headers){if(this.headers.hasOwnProperty(E)){F.conn.setRequestHeader(E,this.headers[E])}}this.headers={};this.hasHeaders=false}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false},abort:function(G,F,E){if(this.isCallInProgress(G)){G.conn.abort();window.clearInterval(this.poll[G.tId]);delete this.poll[G.tId];if(E){delete this.timeout[G.tId]}this.handleTransactionResponse(G,F,true);return true}else{return false}},isCallInProgress:function(E){if(E&&E.conn){return E.conn.readyState!=4&&E.conn.readyState!=0}else{return false}},releaseObject:function(E){E.conn=null;E=null},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(G,H,E,F){this.top=G;this[1]=G;this.right=H;this.bottom=E;this.left=F;this[0]=F};Ext.lib.Region.prototype={contains:function(E){return(E.left>=this.left&&E.right<=this.right&&E.top>=this.top&&E.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(I){var G=Math.max(this.top,I.top);var H=Math.min(this.right,I.right);var E=Math.min(this.bottom,I.bottom);var F=Math.max(this.left,I.left);if(E>=G&&H>=F){return new Ext.lib.Region(G,H,E,F)}else{return null}},union:function(H){var G=Math.min(this.top,H.top);var I=Math.max(this.right,H.right);var E=Math.max(this.bottom,H.bottom);var F=Math.min(this.left,H.left);return new Ext.lib.Region(G,I,E,F)},adjust:function(G,F,E,H){this.top+=G;this.left+=F;this.right+=H;this.bottom+=E;return this}};Ext.lib.Region.getRegion=function(H){var J=Ext.lib.Dom.getXY(H);var G=J[1];var I=J[0]+H.offsetWidth;var E=J[1]+H.offsetHeight;var F=J[0];return new Ext.lib.Region(G,I,E,F)};Ext.lib.Point=function(E,F){if(E instanceof Array){F=E[1];E=E[0]}this.x=this.right=this.left=this[0]=E;this.y=this.top=this.bottom=this[1]=F};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(G,J,I,H,E,F){this.run(G,J,I,H,E,F,Ext.lib.Scroll)},motion:function(J,I,H,G,E,F){this.run(J,I,H,G,E,F,Ext.lib.Motion)},color:function(G,J,I,H,F,E){this.run(G,J,I,H,F,E,Ext.lib.ColorAnim)},run:function(H,L,K,J,E,G,F){F=F||Ext.lib.AnimBase;if(typeof J=="string"){J=Ext.lib.Easing[J]}var I=new F(H,L,K,J);I.animateX(function(){Ext.callback(E,G)});return I}};function B(E){if(!D){D=new Ext.Element.Flyweight()}D.dom=E;return D}if(Ext.isIE){function A(){var E=Function.prototype;delete E.createSequence;delete E.defer;delete E.createDelegate;delete E.createCallback;delete E.createInterceptor;window.detachEvent("onunload",A)}window.attachEvent("onunload",A)}Ext.lib.AnimBase=function(E,H,G,F){if(E){this.init(E,H,G,F)}};Ext.lib.AnimBase.prototype={toString:function(){var E=this.getEl();var F=E.id||E.tagName;return("Anim "+F)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(E,G,F){return this.method(this.currentFrame,G,F-G,this.totalFrames)},setAttribute:function(E,G,F){if(this.patterns.noNegatives.test(E)){G=(G>0)?G:0}Ext.fly(this.getEl(),"_anim").setStyle(E,G+F)},getAttribute:function(E){var G=this.getEl();var I=B(G).getStyle(E);if(I!=="auto"&&!this.patterns.offsetUnit.test(I)){return parseFloat(I)}var F=this.patterns.offsetAttribute.exec(E)||[];var J=!!(F[3]);var H=!!(F[2]);if(H||(B(G).getStyle("position")=="absolute"&&J)){I=G["offset"+F[0].charAt(0).toUpperCase()+F[0].substr(1)]}else{I=0}return I},getDefaultUnit:function(E){if(this.patterns.defaultUnit.test(E)){return"px"}return""},animateX:function(G,E){var F=function(){this.onComplete.removeListener(F);if(typeof G=="function"){G.call(E||this,this)}};this.onComplete.addListener(F,this);this.animate()},setRuntimeAttribute:function(G){var F;var H;var J=this.attributes;this.runtimeAttributes[G]={};var K=function(L){return(typeof L!=="undefined")};if(!K(J[G]["to"])&&!K(J[G]["by"])){return false}F=(K(J[G]["from"]))?J[G]["from"]:this.getAttribute(G);if(K(J[G]["to"])){H=J[G]["to"]}else{if(K(J[G]["by"])){if(F.constructor==Array){H=[];for(var I=0,E=F.length;I<E;++I){H[I]=F[I]+J[G]["by"][I]}}else{H=F+J[G]["by"]}}}this.runtimeAttributes[G].start=F;this.runtimeAttributes[G].end=H;this.runtimeAttributes[G].unit=(K(J[G].unit))?J[G]["unit"]:this.getDefaultUnit(G)},init:function(I,J,H,G){var E=false;var N=null;var L=0;I=Ext.getDom(I);this.attributes=J||{};this.duration=H||1;this.method=G||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return I};this.isAnimated=function(){return E};this.getStartTime=function(){return N};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this)};this.stop=function(O){if(O){this.currentFrame=this.totalFrames;this._onTween.fire()}Ext.lib.AnimMgr.stop(this)};var K=function(){this.onStart.fire();this.runtimeAttributes={};for(var O in this.attributes){this.setRuntimeAttribute(O)}E=true;L=0;N=new Date()};var F=function(){var Q={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};Q.toString=function(){return("duration: "+Q.duration+", currentFrame: "+Q.currentFrame)};this.onTween.fire(Q);var P=this.runtimeAttributes;for(var O in P){this.setAttribute(O,this.doMethod(O,P[O].start,P[O].end),P[O].unit)}L+=1};var M=function(){var P=(new Date()-N)/1000;var O={duration:P,frames:L,fps:L/P};O.toString=function(){return("duration: "+O.duration+", frames: "+O.frames+", fps: "+O.fps)};E=false;L=0;this.onComplete.fire(O)};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(K);this._onTween.addListener(F);this._onComplete.addListener(M)}};Ext.lib.AnimMgr=new function(){var I=null;var H=[];var F=0;this.fps=1000;this.delay=1;this.registerElement=function(J){H[H.length]=J;F+=1;J._onStart.fire();this.start()};this.unRegister=function(J,K){J._onComplete.fire();K=K||G(J);if(K!=-1){H.splice(K,1)}F-=1;if(F<=0){this.stop()}};this.start=function(){if(I===null){I=setInterval(this.run,this.delay)}};this.stop=function(L){if(!L){clearInterval(I);for(var K=0,J=H.length;K<J;++K){if(H[0].isAnimated()){this.unRegister(H[0],0)}}H=[];I=null;F=0}else{this.unRegister(L)}};this.run=function(){for(var L=0,J=H.length;L<J;++L){var K=H[L];if(!K||!K.isAnimated()){continue}if(K.currentFrame<K.totalFrames||K.totalFrames===null){K.currentFrame+=1;if(K.useSeconds){E(K)}K._onTween.fire()}else{Ext.lib.AnimMgr.stop(K,L)}}};var G=function(L){for(var K=0,J=H.length;K<J;++K){if(H[K]==L){return K}}return -1};var E=function(N){var L=N.totalFrames;var K=N.currentFrame;var J=(N.currentFrame*N.duration*1000/N.totalFrames);var O=(new Date()-N.getStartTime());var M=0;if(O<N.duration*1000){M=Math.round((O/J-1)*N.currentFrame)}else{M=L-(K+1)}if(M>0&&isFinite(M)){if(N.currentFrame+M>=L){M=L-(K+1)}N.currentFrame+=M}}};Ext.lib.Bezier=new function(){this.getPosition=function(I,H){var J=I.length;var G=[];for(var F=0;F<J;++F){G[F]=[I[F][0],I[F][1]]}for(var E=1;E<J;++E){for(F=0;F<J-E;++F){G[F][0]=(1-H)*G[F][0]+H*G[parseInt(F+1,10)][0];G[F][1]=(1-H)*G[F][1]+H*G[parseInt(F+1,10)][1]}}return[G[0][0],G[0][1]]}};(function(){Ext.lib.ColorAnim=function(K,J,I,H){Ext.lib.ColorAnim.superclass.constructor.call(this,K,J,I,H)};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var G=Ext.lib;var F=G.ColorAnim.superclass;var E=G.ColorAnim.prototype;E.toString=function(){var H=this.getEl();var I=H.id||H.tagName;return("ColorAnim "+I)};E.patterns.color=/color$/i;E.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;E.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;E.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;E.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;E.parseColor=function(H){if(H.length==3){return H}var I=this.patterns.hex.exec(H);if(I&&I.length==4){return[parseInt(I[1],16),parseInt(I[2],16),parseInt(I[3],16)]}I=this.patterns.rgb.exec(H);if(I&&I.length==4){return[parseInt(I[1],10),parseInt(I[2],10),parseInt(I[3],10)]}I=this.patterns.hex3.exec(H);if(I&&I.length==4){return[parseInt(I[1]+I[1],16),parseInt(I[2]+I[2],16),parseInt(I[3]+I[3],16)]}return null};E.getAttribute=function(H){var I=this.getEl();if(this.patterns.color.test(H)){var K=B(I).getStyle(H);if(this.patterns.transparent.test(K)){var J=I.parentNode;K=B(J).getStyle(H);while(J&&this.patterns.transparent.test(K)){J=J.parentNode;K=B(J).getStyle(H);if(J.tagName.toUpperCase()=="HTML"){K="#fff"}}}}else{K=F.getAttribute.call(this,H)}return K};E.doMethod=function(I,L,J){var M;if(this.patterns.color.test(I)){M=[];for(var K=0,H=L.length;K<H;++K){M[K]=F.doMethod.call(this,I,L[K],J[K])}M="rgb("+Math.floor(M[0])+","+Math.floor(M[1])+","+Math.floor(M[2])+")"}else{M=F.doMethod.call(this,I,L,J)}return M};E.setRuntimeAttribute=function(I){F.setRuntimeAttribute.call(this,I);if(this.patterns.color.test(I)){var M=this.attributes;var L=this.parseColor(this.runtimeAttributes[I].start);var J=this.parseColor(this.runtimeAttributes[I].end);if(typeof M[I]["to"]==="undefined"&&typeof M[I]["by"]!=="undefined"){J=this.parseColor(M[I].by);for(var K=0,H=L.length;K<H;++K){J[K]=L[K]+J[K]}}this.runtimeAttributes[I].start=L;this.runtimeAttributes[I].end=J}}})();Ext.lib.Easing={easeNone:function(F,E,H,G){return H*F/G+E},easeIn:function(F,E,H,G){return H*(F/=G)*F+E},easeOut:function(F,E,H,G){return -H*(F/=G)*(F-2)+E},easeBoth:function(F,E,H,G){if((F/=G/2)<1){return H/2*F*F+E}return -H/2*((--F)*(F-2)-1)+E},easeInStrong:function(F,E,H,G){return H*(F/=G)*F*F*F+E},easeOutStrong:function(F,E,H,G){return -H*((F=F/G-1)*F*F*F-1)+E},easeBothStrong:function(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F+E}return -H/2*((F-=2)*F*F*F-2)+E},elasticIn:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}return -(F*Math.pow(2,10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I))+E},elasticOut:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}return F*Math.pow(2,-10*G)*Math.sin((G*J-H)*(2*Math.PI)/I)+K+E},elasticBoth:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J/2)==2){return E+K}if(!I){I=J*(0.3*1.5)}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}if(G<1){return -0.5*(F*Math.pow(2,10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I))+E}return F*Math.pow(2,-10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I)*0.5+K+E},backIn:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}return I*(F/=H)*F*((G+1)*F-G)+E},backOut:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}return I*((F=F/H-1)*F*((G+1)*F+G)+1)+E},backBoth:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}if((F/=H/2)<1){return I/2*(F*F*(((G*=(1.525))+1)*F-G))+E}return I/2*((F-=2)*F*(((G*=(1.525))+1)*F+G)+2)+E},bounceIn:function(F,E,H,G){return H-Ext.lib.Easing.bounceOut(G-F,0,H,G)+E},bounceOut:function(F,E,H,G){if((F/=G)<(1/2.75)){return H*(7.5625*F*F)+E}else{if(F<(2/2.75)){return H*(7.5625*(F-=(1.5/2.75))*F+0.75)+E}else{if(F<(2.5/2.75)){return H*(7.5625*(F-=(2.25/2.75))*F+0.9375)+E}}}return H*(7.5625*(F-=(2.625/2.75))*F+0.984375)+E},bounceBoth:function(F,E,H,G){if(F<G/2){return Ext.lib.Easing.bounceIn(F*2,0,H,G)*0.5+E}return Ext.lib.Easing.bounceOut(F*2-G,0,H,G)*0.5+H*0.5+E}};(function(){Ext.lib.Motion=function(M,L,K,J){if(M){Ext.lib.Motion.superclass.constructor.call(this,M,L,K,J)}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var I=Ext.lib;var H=I.Motion.superclass;var G=I.Motion.prototype;G.toString=function(){var J=this.getEl();var K=J.id||J.tagName;return("Motion "+K)};G.patterns.points=/^points$/i;G.setAttribute=function(J,L,K){if(this.patterns.points.test(J)){K=K||"px";H.setAttribute.call(this,"left",L[0],K);H.setAttribute.call(this,"top",L[1],K)}else{H.setAttribute.call(this,J,L,K)}};G.getAttribute=function(J){if(this.patterns.points.test(J)){var K=[H.getAttribute.call(this,"left"),H.getAttribute.call(this,"top")]}else{K=H.getAttribute.call(this,J)}return K};G.doMethod=function(J,L,K){var N=null;if(this.patterns.points.test(J)){var M=this.method(this.currentFrame,0,100,this.totalFrames)/100;N=I.Bezier.getPosition(this.runtimeAttributes[J],M)}else{N=H.doMethod.call(this,J,L,K)}return N};G.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var K=this.getEl();var J=this.attributes;var R;var S=J["points"]["control"]||[];var L;var N,O;if(S.length>0&&!(S[0] instanceof Array)){S=[S]}else{var M=[];for(N=0,O=S.length;N<O;++N){M[N]=S[N]}S=M}Ext.fly(K).position();if(F(J["points"]["from"])){Ext.lib.Dom.setXY(K,J["points"]["from"])}else{Ext.lib.Dom.setXY(K,Ext.lib.Dom.getXY(K))}R=this.getAttribute("points");if(F(J["points"]["to"])){L=E.call(this,J["points"]["to"],R);var Q=Ext.lib.Dom.getXY(this.getEl());for(N=0,O=S.length;N<O;++N){S[N]=E.call(this,S[N],R)}}else{if(F(J["points"]["by"])){L=[R[0]+J["points"]["by"][0],R[1]+J["points"]["by"][1]];for(N=0,O=S.length;N<O;++N){S[N]=[R[0]+S[N][0],R[1]+S[N][1]]}}}this.runtimeAttributes[P]=[R];if(S.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(S)}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=L}else{H.setRuntimeAttribute.call(this,P)}};var E=function(L,J){var K=Ext.lib.Dom.getXY(this.getEl());L=[L[0]-K[0]+J[0],L[1]-K[1]+J[1]];return L};var F=function(J){return(typeof J!=="undefined")}})();(function(){Ext.lib.Scroll=function(K,J,I,H){if(K){Ext.lib.Scroll.superclass.constructor.call(this,K,J,I,H)}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var G=Ext.lib;var F=G.Scroll.superclass;var E=G.Scroll.prototype;E.toString=function(){var H=this.getEl();var I=H.id||H.tagName;return("Scroll "+I)};E.doMethod=function(H,J,I){var K=null;if(H=="scroll"){K=[this.method(this.currentFrame,J[0],I[0]-J[0],this.totalFrames),this.method(this.currentFrame,J[1],I[1]-J[1],this.totalFrames)]}else{K=F.doMethod.call(this,H,J,I)}return K};E.getAttribute=function(H){var J=null;var I=this.getEl();if(H=="scroll"){J=[I.scrollLeft,I.scrollTop]}else{J=F.getAttribute.call(this,H)}return J};E.setAttribute=function(H,K,J){var I=this.getEl();if(H=="scroll"){I.scrollLeft=K[0];I.scrollTop=K[1]}else{F.setAttribute.call(this,H,K,J)}}})()})();Ext.DomHelper=function(){var M=null;var L=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var K=/^table|tbody|tr|td$/i;var I=function(T){if(typeof T=="string"){return T}var O="";if(!T.tag){T.tag="div"}O+="<"+T.tag;for(var Q in T){if(Q=="tag"||Q=="children"||Q=="cn"||Q=="html"||typeof T[Q]=="function"){continue}if(Q=="style"){var S=T["style"];if(typeof S=="function"){S=S.call()}if(typeof S=="string"){O+=' style="'+S+'"'}else{if(typeof S=="object"){O+=' style="';for(var N in S){if(typeof S[N]!="function"){O+=N+":"+S[N]+";"}}O+='"'}}}else{if(Q=="cls"){O+=' class="'+T["cls"]+'"'}else{if(Q=="htmlFor"){O+=' for="'+T["htmlFor"]+'"'}else{O+=" "+Q+'="'+T[Q]+'"'}}}}if(L.test(T.tag)){O+="/>"}else{O+=">";var U=T.children||T.cn;if(U){if(U instanceof Array){for(var R=0,P=U.length;R<P;R++){O+=I(U[R],O)}}else{O+=I(U,O)}}if(T.html){O+=T.html}O+="</"+T.tag+">"}return O};var G=function(S,U){var P=document.createElement(S.tag||"div");var R=P.setAttribute?true:false;for(var Q in S){if(Q=="tag"||Q=="children"||Q=="cn"||Q=="html"||Q=="style"||typeof S[Q]=="function"){continue}if(Q=="cls"){P.className=S["cls"]}else{if(R){P.setAttribute(Q,S[Q])}else{P[Q]=S[Q]}}}Ext.DomHelper.applyStyles(P,S.style);var T=S.children||S.cn;if(T){if(T instanceof Array){for(var O=0,N=T.length;O<N;O++){G(T[O],P)}}else{G(T,P)}}if(S.html){P.innerHTML=S.html}if(U){U.appendChild(P)}return P};var E=function(N,R,Q,S){M.innerHTML=[R,Q,S].join("");var O=-1,P=M;while(++O<N){P=P.firstChild}return P};var H="<table>",D="</table>",B=H+"<tbody>",J="</tbody>"+D,F=B+"<tr>",C="</tr>"+J;var A=function(N,S,R,Q){if(!M){M=document.createElement("div")}var P;var O=null;if(N=="td"){if(S=="afterbegin"||S=="beforeend"){return }if(S=="beforebegin"){O=R;R=R.parentNode}else{O=R.nextSibling;R=R.parentNode}P=E(4,F,Q,C)}else{if(N=="tr"){if(S=="beforebegin"){O=R;R=R.parentNode;P=E(3,B,Q,J)}else{if(S=="afterend"){O=R.nextSibling;R=R.parentNode;P=E(3,B,Q,J)}else{if(S=="afterbegin"){O=R.firstChild}P=E(4,F,Q,C)}}}else{if(N=="tbody"){if(S=="beforebegin"){O=R;R=R.parentNode;P=E(2,H,Q,D)}else{if(S=="afterend"){O=R.nextSibling;R=R.parentNode;P=E(2,H,Q,D)}else{if(S=="afterbegin"){O=R.firstChild}P=E(3,B,Q,J)}}}else{if(S=="beforebegin"||S=="afterend"){return }if(S=="afterbegin"){O=R.firstChild}P=E(2,H,Q,D)}}}R.insertBefore(P,O);return P};return{useDom:false,markup:function(N){return I(N)},applyStyles:function(R,Q){if(Q){R=Ext.fly(R);if(typeof Q=="string"){var P=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var O;while((O=P.exec(Q))!=null){R.setStyle(O[1],O[2])}}else{if(typeof Q=="object"){for(var N in Q){R.setStyle(N,Q[N])}}else{if(typeof Q=="function"){Ext.DomHelper.applyStyles(R,Q.call())}}}}},insertHtml:function(P,Q,N){P=P.toLowerCase();if(Q.insertAdjacentHTML){if(K.test(Q.tagName)){var O;if(O=A(Q.tagName.toLowerCase(),P,Q,N)){return O}}switch(P){case"beforebegin":Q.insertAdjacentHTML("BeforeBegin",N);return Q.previousSibling;case"afterbegin":Q.insertAdjacentHTML("AfterBegin",N);return Q.firstChild;case"beforeend":Q.insertAdjacentHTML("BeforeEnd",N);return Q.lastChild;case"afterend":Q.insertAdjacentHTML("AfterEnd",N);return Q.nextSibling}throw'Illegal insertion point -> "'+P+'"'}var S=Q.ownerDocument.createRange();var R;switch(P){case"beforebegin":S.setStartBefore(Q);R=S.createContextualFragment(N);Q.parentNode.insertBefore(R,Q);return Q.previousSibling;case"afterbegin":if(Q.firstChild){S.setStartBefore(Q.firstChild);R=S.createContextualFragment(N);Q.insertBefore(R,Q.firstChild);return Q.firstChild}else{Q.innerHTML=N;return Q.firstChild}case"beforeend":if(Q.lastChild){S.setStartAfter(Q.lastChild);R=S.createContextualFragment(N);Q.appendChild(R);return Q.lastChild}else{Q.innerHTML=N;return Q.lastChild}case"afterend":S.setStartAfter(Q);R=S.createContextualFragment(N);Q.parentNode.insertBefore(R,Q.nextSibling);return Q.nextSibling}throw'Illegal insertion point -> "'+P+'"'},insertBefore:function(N,P,O){return this.doInsert(N,P,O,"beforeBegin")},insertAfter:function(N,P,O){return this.doInsert(N,P,O,"afterEnd","nextSibling")},insertFirst:function(O,P,N){return this.doInsert(O,P,N,"afterBegin")},doInsert:function(R,S,Q,T,P){R=Ext.getDom(R);var O;if(this.useDom){O=G(S,null);R.parentNode.insertBefore(O,P?R[P]:R)}else{var N=I(S);O=this.insertHtml(T,R,N)}return Q?Ext.get(O,true):O},append:function(O,R,Q){O=Ext.getDom(O);var P;if(this.useDom){P=G(R,null);O.appendChild(P)}else{var N=I(R);P=this.insertHtml("beforeEnd",O,N)}return Q?Ext.get(P,true):P},overwrite:function(N,P,O){N=Ext.getDom(N);N.innerHTML=I(P);return O?Ext.get(N.firstChild,true):N.firstChild},createTemplate:function(O){var N=I(O);return new Ext.Template(N)}}}();Ext.Template=function(A){if(A instanceof Array){A=A.join("")}else{if(arguments.length>1){A=Array.prototype.join.call(arguments,"")}}this.html=A};Ext.Template.prototype={applyTemplate:function(E){if(this.compiled){return this.compiled(E)}var D=this.disableFormats!==true;var C=Ext.util.Format,A=this;var B=function(G,I,F,K){if(F&&D){if(F.substr(0,5)=="this."){return A.call(F.substr(5),E[I],E)}else{if(K){var L=/^\s*['"](.*)["']\s*$/;K=K.split(",");for(var J=0,H=K.length;J<H;J++){K[J]=K[J].replace(L,"$1")}K=[E[I]].concat(K)}else{K=[E[I]]}return C[F].apply(C,K)}}else{return E[I]!==undefined?E[I]:""}};return this.html.replace(this.re,B)},set:function(A,B){this.html=A;this.compiled=null;if(B){this.compile()}return this},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Ext.util.Format;var _11=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,_15,_16,_17){if(_16&&_11){_17=_17?","+_17:"";if(_16.substr(0,5)!="this."){_16="fm."+_16+"("}else{_16='this.call("'+_16.substr(5)+'", ';_17=", values"}}else{_17="";_16="(values['"+_15+"'] == undefined ? '' : "}return"'"+sep+_16+"values['"+_15+"']"+_17+")"+sep+"'"};var _18;if(Ext.isGecko){_18="this.compiled = function(values){ return '"+this.html.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{_18=["this.compiled = function(values){ return ['"];_18.push(this.html.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));_18.push("'].join('');};");_18=_18.join("")}eval(_18);return this},call:function(A,C,B){return this[A](C,B)},insertFirst:function(C,B,A){return this.doInsert("afterBegin",C,B,A)},insertBefore:function(C,B,A){return this.doInsert("beforeBegin",C,B,A)},insertAfter:function(A,C,B){return this.doInsert("afterEnd",A,C,B)},append:function(B,C,A){return this.doInsert("beforeEnd",B,C,A)},doInsert:function(A,C,E,D){C=Ext.getDom(C);var B=Ext.DomHelper.insertHtml(A,C,this.applyTemplate(E));return D?Ext.get(B,true):B},overwrite:function(C,B,A){C=Ext.getDom(C);C.innerHTML=this.applyTemplate(B);return A?Ext.get(C.firstChild,true):C.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomHelper.Template=Ext.Template;Ext.Template.from=function(A){A=Ext.getDom(A);return new Ext.Template(A.value||A.innerHTML)};Ext.DomQuery=function(){var _1={},_2={},_3={};var _4=/\S/;var _5=/^\s+|\s+$/g;var _6=/\{(\d+)\}/g;var _7=/^(\s?[\/>+~]\s?|\s|$)/;var _8=/^(#)?([\w-\*]+)/;var _9=/(\d*)n\+?(\d*)/,_a=/\D/;function child(p,_c){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==_c){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!_4.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}function attrValue(n,_1e){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(_1e=="for"){return n.htmlFor}if(_1e=="class"||_1e=="className"){return n.className}return n.getAttribute(_1e)||n[_1e]}function getNodes(ns,_20,_21){var _22=[],ri=-1,cs;if(!ns){return _22}_21=_21||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!_20){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(_21);for(var j=0,ci;ci=cs[j];j++){_22[++ri]=ci}}}else{if(_20=="/"||_20==">"){var _29=_21.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==_29||cj.nodeName==_21||_21=="*"){_22[++ri]=cj}}}}else{if(_20=="+"){var _29=_21.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==_29||n.nodeName==_21||_21=="*")){_22[++ri]=n}}}else{if(_20=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(_21=="*"||n.tagName.toLowerCase()!=_21))){}if(n){_22[++ri]=n}}}}}}return _22}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,_32){if(cs.tagName||cs==document){cs=[cs]}if(!_32){return cs}var r=[],ri=-1;_32=_32.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==_32){r[++ri]=ci}}return r}function byId(cs,_38,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,_3f,_40,op,_42){var r=[],ri=-1,st=_42=="{";var f=Ext.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Ext.DomQuery.getStyle(ci,_3f)}else{if(_3f=="class"||_3f=="className"){a=ci.className}else{if(_3f=="for"){a=ci.htmlFor}else{if(_3f=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(_3f)}}}}if((f&&f(a,_40))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,_4b,_4c){return Ext.DomQuery.pseudos[_4b](cs,_4c)}var _4d=window.ActiveXObject?true:false;eval("var batch = 30803;");var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(_4d&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var _66=c1.length;if(!_66){return c2}if(_4d&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<_66;i++){c1[i]._qdiff=d}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,_6c,_6d,id){if(ns==_6d){var d=_6d.ownerDocument||_6d;return d.getElementById(id)}ns=getNodes(ns,_6c,"*");return byId(ns,null,id)}return{getStyle:function(el,_71){return Ext.fly(el).getStyle(_71)},compile:function(_72,_73){_73=_73||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=_72,_76,lq;var tk=Ext.DomQuery.matchers;var _79=tk.length;var mm;var _7b=q.match(_7);if(_7b&&_7b[1]){fn[fn.length]='mode="'+_7b[1].replace(_5,"")+'";';q=q.replace(_7b[1],"")}while(_72.substr(0,1)=="/"){_72=_72.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(_8);if(_73=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(_7))){var _7d=false;for(var j=0;j<_79;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(_6,function(x,i){return m[i]});q=q.replace(m[0],"");_7d=true;break}}if(!_7d){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(_5,"")+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(_83,_84,_85){if(!_84||_84==document){_84=document}if(typeof _84=="string"){_84=document.getElementById(_84)}var _86=_83.split(",");var _87=[];for(var i=0,len=_86.length;i<len;i++){var p=_86[i].replace(_5,"");if(!_1[p]){_1[p]=Ext.DomQuery.compile(p);if(!_1[p]){throw p+" is not a valid selector"}}var _8b=_1[p](_84);if(_8b&&_8b!=document){_87=_87.concat(_8b)}}if(_86.length>1){return nodup(_87)}return _87},selectNode:function(_8c,_8d){return Ext.DomQuery.select(_8c,_8d)[0]},selectValue:function(_8e,_8f,_90){_8e=_8e.replace(_5,"");if(!_3[_8e]){_3[_8e]=Ext.DomQuery.compile(_8e,"select")}var n=_3[_8e](_8f);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?_90:v)},selectNumber:function(_93,_94,_95){var v=Ext.DomQuery.selectValue(_93,_94,_95||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var _99=(el instanceof Array);var _9a=Ext.DomQuery.filter(_99?el:[el],ss);return _99?(_9a.length==el.length):(_9a.length>0)},filter:function(els,ss,_9d){ss=ss.replace(_5,"");if(!_2[ss]){_2[ss]=Ext.DomQuery.compile(ss,"simple")}var _9e=_2[ss](els);return _9d?quickDiff(_9e,els):_9e},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1;var m=_9.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!_a.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,_d4=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){_d4=false;break}}if(_d4){r[++ri]=ci}}return r},"contains":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},"nodeValue":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},"checked":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},"not":function(c,ss){return Ext.DomQuery.filter(c,ss,true)},"odd":function(c){return this["nth-child"](c,"odd")},"even":function(c){return this["nth-child"](c,"even")},"nth":function(c,a){return c[a-1]||[]},"first":function(c){return c[0]||[]},"last":function(c){return c[c.length-1]||[]},"has":function(c,ss){var s=Ext.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},"next":function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},"prev":function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.Observable=function(){if(this.listeners){this.on(this.listeners);delete this.listeners}};Ext.util.Observable.prototype={fireEvent:function(){var A=this.events[arguments[0].toLowerCase()];if(typeof A=="object"){return A.fire.apply(A,Array.prototype.slice.call(arguments,1))}else{return true}},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(C,B,A,F){if(typeof C=="object"){F=C;for(var E in F){if(this.filterOptRe.test(E)){continue}if(typeof F[E]=="function"){this.addListener(E,F[E],F.scope,F)}else{this.addListener(E,F[E].fn,F[E].scope,F[E])}}return }F=(!F||typeof F=="boolean")?{}:F;C=C.toLowerCase();var D=this.events[C]||true;if(typeof D=="boolean"){D=new Ext.util.Event(this,C);this.events[C]=D}D.addListener(B,A,F)},removeListener:function(A,C,B){var D=this.events[A.toLowerCase()];if(typeof D=="object"){D.removeListener(C,B)}},purgeListeners:function(){for(var A in this.events){if(typeof this.events[A]=="object"){this.events[A].clearListeners()}}},relayEvents:function(E,B){var F=function(G){return function(){return this.fireEvent.apply(this,Ext.combine(G,Array.prototype.slice.call(arguments,0)))}};for(var C=0,A=B.length;C<A;C++){var D=B[C];if(!this.events[D]){this.events[D]=true}E.on(D,F(D),this)}},addEvents:function(A){if(!this.events){this.events={}}Ext.applyIf(this.events,A)},hasListener:function(A){var B=this.events[A];return typeof B=="object"&&B.listeners.length>0}};Ext.util.Observable.prototype.on=Ext.util.Observable.prototype.addListener;Ext.util.Observable.prototype.un=Ext.util.Observable.prototype.removeListener;Ext.util.Observable.capture=function(C,B,A){C.fireEvent=C.fireEvent.createInterceptor(B,A)};Ext.util.Observable.releaseCapture=function(A){A.fireEvent=Ext.util.Observable.prototype.fireEvent};(function(){var B=function(F,G,E){var D=new Ext.util.DelayedTask();return function(){D.delay(G.buffer,F,E,Array.prototype.slice.call(arguments,0))}};var A=function(E,G,D,F){return function(){G.removeListener(D,F);return E.apply(F,arguments)}};var C=function(E,F,D){return function(){var G=Array.prototype.slice.call(arguments,0);setTimeout(function(){E.apply(D,G)},F.delay||10)}};Ext.util.Event=function(E,D){this.name=D;this.obj=E;this.listeners=[]};Ext.util.Event.prototype={addListener:function(H,F,E){var I=E||{};F=F||this.obj;if(!this.isListening(H,F)){var D={fn:H,scope:F,options:I};var G=H;if(I.delay){G=C(G,I,F)}if(I.single){G=A(G,this,H,F)}if(I.buffer){G=B(G,I,F)}D.fireFn=G;if(!this.firing){this.listeners.push(D)}else{this.listeners=this.listeners.slice(0);this.listeners.push(D)}}},findListener:function(I,E){E=E||this.obj;var G=this.listeners;for(var H=0,D=G.length;H<D;H++){var F=G[H];if(F.fn==I&&F.scope==E){return H}}return -1},isListening:function(E,D){return this.findListener(E,D)!=-1},removeListener:function(D,F){var E;if((E=this.findListener(D,F))!=-1){if(!this.firing){this.listeners.splice(E,1)}else{this.listeners=this.listeners.slice(0);this.listeners.splice(E,1)}return true}return false},clearListeners:function(){this.listeners=[]},fire:function(){var F=this.listeners,I,D=F.length;if(D>0){this.firing=true;var H=Array.prototype.slice.call(arguments,0);for(var G=0;G<D;G++){var E=F[G];if(E.fireFn.apply(E.scope||this.obj||window,arguments)===false){this.firing=false;return false}}this.firing=false}return true}}})();Ext.EventManager=function(){var O,M,K=false;var J,I,G,F;var Q=Ext.lib.Event;var R=Ext.lib.Dom;var N=function(){if(!K){K=true;Ext.isReady=true;if(M){clearInterval(M)}if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",N,false)}if(O){O.fire();O.clearListeners()}}};var L=function(){O=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",N,false)}else{if(Ext.isIE){document.write('<script id="ie-deferred-loader" defer="defer" src="//:"><\/script>');var D=document.getElementById("ie-deferred-loader");D.onreadystatechange=function(){if(this.readyState=="complete"){N();D.onreadystatechange=null;D.parentNode.removeChild(D)}}}else{if(Ext.isSafari){M=setInterval(function(){var E=document.readyState;if(E=="complete"){N()}},10)}}}Q.on(window,"load",N)};var H=function(D,U){var E=new Ext.util.DelayedTask(D);return function(V){V=new Ext.EventObjectImpl(V);E.delay(U.buffer,D,null,[V])}};var C=function(V,U,D,E){return function(W){Ext.EventManager.removeListener(U,D,E);V(W)}};var A=function(D,E){return function(U){U=new Ext.EventObjectImpl(U);setTimeout(function(){D(U)},E.delay||10)}};var B=function(E,D,U,X,Z){var Y=(!U||typeof U=="boolean")?{}:U;X=X||Y.fn;Z=Z||Y.scope;var W=Ext.getDom(E);if(!W){throw'Error listening for "'+D+'". Element "'+E+"\" doesn't exist."}var V=function(c){c=Ext.EventObject.setEvent(c);var a;if(Y.delegate){a=c.getTarget(Y.delegate,W);if(!a){return }}else{a=c.target}if(Y.stopEvent===true){c.stopEvent()}if(Y.preventDefault===true){c.preventDefault()}if(Y.stopPropagation===true){c.stopPropagation()}if(Y.normalized===false){c=c.browserEvent}X.call(Z||W,c,a,Y)};if(Y.delay){V=A(V,Y)}if(Y.single){V=C(V,W,D,X)}if(Y.buffer){V=H(V,Y)}X._handlers=X._handlers||[];X._handlers.push([Ext.id(W),D,V]);Q.on(W,D,V);if(D=="mousewheel"&&W.addEventListener){W.addEventListener("DOMMouseScroll",V,false);Q.on(window,"unload",function(){W.removeEventListener("DOMMouseScroll",V,false)})}if(D=="mousedown"&&W==document){Ext.EventManager.stoppedMouseDownEvent.addListener(V)}return V};var P=function(U,D,Z){var E=Ext.id(U),a=Z._handlers,X=Z;if(a){for(var V=0,Y=a.length;V<Y;V++){var W=a[V];if(W[0]==E&&W[1]==D){X=W[2];a.splice(V,1);break}}}Q.un(U,D,X);U=Ext.getDom(U);if(D=="mousewheel"&&U.addEventListener){U.removeEventListener("DOMMouseScroll",X,false)}if(D=="mousedown"&&U==document){Ext.EventManager.stoppedMouseDownEvent.removeListener(X)}};var T=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var S={wrap:function(D,U,E){return function(V){Ext.EventObject.setEvent(V);D.call(E?U||window:window,Ext.EventObject,U)}},addListener:function(U,E,D,X,V){if(typeof E=="object"){var Y=E;for(var W in Y){if(T.test(W)){continue}if(typeof Y[W]=="function"){B(U,W,Y,Y[W],Y.scope)}else{B(U,W,Y[W])}}return }return B(U,E,V,D,X)},removeListener:function(D,U,E){return P(D,U,E)},onDocumentReady:function(U,E,D){if(K){U.call(E||window,E);return }if(!O){L()}O.addListener(U,E,D)},onWindowResize:function(D,U,E){if(!J){J=new Ext.util.Event();I=new Ext.util.DelayedTask(function(){J.fire(R.getViewWidth(),R.getViewHeight())});Q.on(window,"resize",function(){if(Ext.isIE){I.delay(50)}else{J.fire(R.getViewWidth(),R.getViewHeight())}})}J.addListener(D,U,E)},onTextResize:function(E,U,D){if(!G){G=new Ext.util.Event();var V=new Ext.Element(document.createElement("div"));V.dom.className="x-text-resize";V.dom.innerHTML="X";V.appendTo(document.body);F=V.dom.offsetHeight;setInterval(function(){if(V.dom.offsetHeight!=F){G.fire(F,F=V.dom.offsetHeight)}},this.textResizeInterval)}G.addListener(E,U,D)},removeResizeListener:function(D,E){if(J){J.removeListener(D,E)}},fireResize:function(){if(J){J.fire(R.getViewWidth(),R.getViewHeight())}},ieDeferSrc:false,textResizeInterval:50};S.on=S.addListener;S.un=S.removeListener;S.stoppedMouseDownEvent=new Ext.util.Event();return S}();Ext.onReady=Ext.EventManager.onDocumentReady;Ext.onReady(function(){var B=Ext.get(document.body);if(!B){return }var A=[Ext.isIE?"ext-ie":Ext.isGecko?"ext-gecko":Ext.isOpera?"ext-opera":Ext.isSafari?"ext-safari":""];if(Ext.isMac){A.push("ext-mac")}if(Ext.isLinux){A.push("ext-linux")}if(Ext.isBorderBox){A.push("ext-border-box")}if(Ext.isStrict){var C=B.dom.parentNode;if(C){C.className=C.className?" ext-strict":"ext-strict"}}B.addClass(A.join(" "))});Ext.EventObject=function(){var C=Ext.lib.Event;var B={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var A=Ext.isIE?{1:0,4:1,2:2}:(Ext.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(D){if(D){this.setEvent(D.browserEvent||D)}};Ext.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,setEvent:function(D){if(D==this||(D&&D.browserEvent)){return D}this.browserEvent=D;if(D){this.button=D.button?A[D.button]:(D.which?D.which-1:-1);if(D.type=="click"&&this.button==-1){this.button=0}this.type=D.type;this.shiftKey=D.shiftKey;this.ctrlKey=D.ctrlKey||D.metaKey;this.altKey=D.altKey;this.keyCode=D.keyCode;this.charCode=D.charCode;this.target=C.getTarget(D);this.xy=C.getXY(D)}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0]}return this},stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}C.stopEvent(this.browserEvent)}},preventDefault:function(){if(this.browserEvent){C.preventDefault(this.browserEvent)}},isNavKeyPress:function(){var D=this.keyCode;D=Ext.isSafari?(B[D]||D):D;return(D>=33&&D<=40)||D==this.RETURN||D==this.TAB||D==this.ESC},isSpecialKey:function(){var D=this.keyCode;return(this.type=="keypress"&&this.ctrlKey)||D==9||D==13||D==40||D==27||(D==16)||(D==17)||(D>=18&&D<=20)||(D>=33&&D<=35)||(D>=36&&D<=39)||(D>=44&&D<=45)},stopPropagation:function(){if(this.browserEvent){if(this.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}C.stopPropagation(this.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){var D=this.keyCode||this.charCode;return Ext.isSafari?(B[D]||D):D},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getTime:function(){if(this.browserEvent){return C.getTime(this.browserEvent)}return null},getXY:function(){return this.xy},getTarget:function(F,E,D){return F?Ext.fly(this.target).findParent(F,E,D):this.target},getRelatedTarget:function(){if(this.browserEvent){return C.getRelatedTarget(this.browserEvent)}return null},getWheelDelta:function(){var D=this.browserEvent;var E=0;if(D.wheelDelta){E=D.wheelDelta/120;if(window.opera){E=-E}}else{if(D.detail){E=-D.detail/3}}return E},hasModifier:function(){return !!((this.ctrlKey||this.altKey)||this.shiftKey)},within:function(E,F){var D=this[F?"getRelatedTarget":"getTarget"]();return D&&Ext.fly(E).contains(D)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])}};return new Ext.EventObjectImpl()}();(function(){var D=Ext.lib.Dom;var E=Ext.lib.Event;var A=Ext.lib.Anim;var _4={};var _5=/(-[a-z])/gi;var _6=function(m,a){return a.charAt(1).toUpperCase()};var _9=document.defaultView;Ext.Element=function(_a,_b){var _c=typeof _a=="string"?document.getElementById(_a):_a;if(!_c){return null}var id=_c.id;if(_b!==true&&id&&Ext.Element.cache[id]){return Ext.Element.cache[id]}this.dom=_c;this.id=id||Ext.id(_c)};var El=Ext.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(_f){this.visibilityMode=_f;return this},enableDisplayMode:function(_10){this.setVisibilityMode(El.DISPLAY);if(typeof _10!="undefined"){this.originalDisplay=_10}return this},findParent:function(_11,_12,_13){var p=this.dom,b=document.body,_16=0,dq=Ext.DomQuery,_18;_12=_12||50;if(typeof _12!="number"){_18=Ext.getDom(_12);_12=10}while(p&&p.nodeType==1&&_16<_12&&p!=b&&p!=_18){if(dq.is(p,_11)){return _13?Ext.get(p):p}_16++;p=p.parentNode}return null},findParentNode:function(_19,_1a,_1b){var p=Ext.fly(this.dom.parentNode,"_internal");return p?p.findParent(_19,_1a,_1b):null},up:function(_1d,_1e){return this.findParentNode(_1d,_1e,true)},is:function(_1f){return Ext.DomQuery.is(this.dom,_1f)},animate:function(_20,_21,_22,_23,_24){this.anim(_20,{duration:_21,callback:_22,easing:_23},_24);return this},anim:function(_25,opt,_27,_28,_29,cb){_27=_27||"run";opt=opt||{};var _2b=Ext.lib.Anim[_27](this.dom,_25,(opt.duration||_28)||0.35,(opt.easing||_29)||"easeOut",function(){Ext.callback(cb,this);Ext.callback(opt.callback,opt.scope||this,[this,opt])},this);opt.anim=_2b;return _2b},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]})},clean:function(_2e){if(this.isCleaned&&_2e!==true){return this}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}this.isCleaned=true;return this},calcOffsetsTo:function(el){el=Ext.get(el);var d=el.dom;var _36=false;if(el.getStyle("position")=="static"){el.position("relative");_36=true}var x=0,y=0;var op=this.dom;while(op&&op!=d&&op.tagName!="HTML"){x+=op.offsetLeft;y+=op.offsetTop;op=op.offsetParent}if(_36){el.position("static")}return[x,y]},scrollIntoView:function(_3a,_3b){var c=Ext.getDom(_3a)||document.body;var el=this.dom;var o=this.calcOffsetsTo(c),l=o[0],t=o[1],b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(t<ct){c.scrollTop=t}else{if(b>cb){c.scrollTop=b-ch}}if(_3b!==false){if(l<cl){c.scrollLeft=l}else{if(r>cr){c.scrollLeft=r-c.clientWidth}}}return this},scrollChildIntoView:function(_48,_49){Ext.fly(_48,"_scrollChildIntoView").scrollIntoView(this,_49)},autoHeight:function(_4a,_4b,_4c,_4d){var _4e=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var _4f=parseInt(this.dom.scrollHeight,10);if(!_4a){this.setHeight(_4f);this.unclip();if(typeof _4c=="function"){_4c()}}else{this.setHeight(_4e);this.setHeight(_4f,_4a,_4b,function(){this.unclip();if(typeof _4c=="function"){_4c()}}.createDelegate(this),_4d)}}.createDelegate(this),0);return this},contains:function(el){if(!el){return false}return D.isAncestor(this.dom,el.dom?el.dom:el)},isVisible:function(_51){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(_51!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true},select:function(_54,_55){return El.select(_54,_55,this.dom)},query:function(_56,_57){return Ext.DomQuery.select(_56,this.dom)},child:function(_58,_59){var n=Ext.DomQuery.selectNode(_58,this.dom);return _59?n:Ext.get(n)},down:function(_5b,_5c){var n=Ext.DomQuery.selectNode(" > "+_5b,this.dom);return _5c?n:Ext.get(n)},initDD:function(_5e,_5f,_60){var dd=new Ext.dd.DD(Ext.id(this.dom),_5e,_5f);return Ext.apply(dd,_60)},initDDProxy:function(_62,_63,_64){var dd=new Ext.dd.DDProxy(Ext.id(this.dom),_62,_63);return Ext.apply(dd,_64)},initDDTarget:function(_66,_67,_68){var dd=new Ext.dd.DDTarget(Ext.id(this.dom),_66,_67);return Ext.apply(dd,_68)},setVisible:function(_6a,_6b){if(!_6b||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(_6a)}else{this.fixDisplay();this.dom.style.visibility=_6a?"visible":"hidden"}}else{var dom=this.dom;var _6d=this.visibilityMode;if(_6a){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(_6a?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!_6a){if(_6d==El.DISPLAY){dom.style.display="none"}else{dom.style.visibility="hidden"}Ext.get(dom).setOpacity(1)}})}return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(_6e){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this},setDisplayed:function(_6f){if(typeof _6f=="boolean"){_6f=_6f?this.originalDisplay:"none"}this.setStyle("display",_6f);return this},focus:function(){try{this.dom.focus()}catch(e){}return this},blur:function(){try{this.dom.blur()}catch(e){}return this},addClass:function(_70){if(_70 instanceof Array){for(var i=0,len=_70.length;i<len;i++){this.addClass(_70[i])}}else{if(_70&&!this.hasClass(_70)){this.dom.className=this.dom.className+" "+_70}}return this},radioClass:function(_73){var _74=this.dom.parentNode.childNodes;for(var i=0;i<_74.length;i++){var s=_74[i];if(s.nodeType==1){Ext.get(s).removeClass(_73)}}this.addClass(_73);return this},removeClass:function(_77){if(!_77||!this.dom.className){return this}if(_77 instanceof Array){for(var i=0,len=_77.length;i<len;i++){this.removeClass(_77[i])}}else{if(this.hasClass(_77)){var re=this.classReCache[_77];if(!re){re=new RegExp("(?:^|\\s+)"+_77+"(?:\\s+|$)","g");this.classReCache[_77]=re}this.dom.className=this.dom.className.replace(re," ")}}return this},classReCache:{},toggleClass:function(_7b){if(this.hasClass(_7b)){this.removeClass(_7b)}else{this.addClass(_7b)}return this},hasClass:function(_7c){return _7c&&(" "+this.dom.className+" ").indexOf(" "+_7c+" ")!=-1},replaceClass:function(_7d,_7e){this.removeClass(_7d);this.addClass(_7e);return this},getStyles:function(){var a=arguments,len=a.length,r={};for(var i=0;i<len;i++){r[a[i]]=this.getStyle(a[i])}return r},getStyle:function(){return _9&&_9.getComputedStyle?function(_83){var el=this.dom,v,cs,_87;if(_83=="float"){_83="cssFloat"}if(v=el.style[_83]){return v}if(cs=_9.getComputedStyle(el,"")){if(!(_87=_4[_83])){_87=_4[_83]=_83.replace(_5,_6)}return cs[_87]}return null}:function(_88){var el=this.dom,v,cs,_8c;if(_88=="opacity"){if(typeof el.style.filter=="string"){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0}}}return 1}else{if(_88=="float"){_88="styleFloat"}}if(!(_8c=_4[_88])){_8c=_4[_88]=_88.replace(_5,_6)}if(v=el.style[_8c]){return v}if(cs=el.currentStyle){return cs[_8c]}return null}}(),setStyle:function(_8f,_90){if(typeof _8f=="string"){var _91;if(!(_91=_4[_8f])){_91=_4[_8f]=_8f.replace(_5,_6)}if(_91=="opacity"){this.setOpacity(_90)}else{this.dom.style[_91]=_90}}else{for(var _92 in _8f){if(typeof _8f[_92]!="function"){this.setStyle(_92,_8f[_92])}}}return this},applyStyles:function(_93){Ext.DomHelper.applyStyles(this.dom,_93);return this},getX:function(){return D.getX(this.dom)},getY:function(){return D.getY(this.dom)},getXY:function(){return D.getXY(this.dom)},setX:function(x,_95){if(!_95||!A){D.setX(this.dom,x)}else{this.setXY([x,this.getY()],this.preanim(arguments,1))}return this},setY:function(y,_97){if(!_97||!A){D.setY(this.dom,y)}else{this.setXY([this.getX(),y],this.preanim(arguments,1))}return this},setLeft:function(_98){this.setStyle("left",this.addUnits(_98));return this},setTop:function(top){this.setStyle("top",this.addUnits(top));return this},setRight:function(_9a){this.setStyle("right",this.addUnits(_9a));return this},setBottom:function(_9b){this.setStyle("bottom",this.addUnits(_9b));return this},setXY:function(pos,_9d){if(!_9d||!A){D.setXY(this.dom,pos)}else{this.anim({points:{to:pos}},this.preanim(arguments,1),"motion")}return this},setLocation:function(x,y,_a0){this.setXY([x,y],this.preanim(arguments,2));return this},moveTo:function(x,y,_a3){this.setXY([x,y],this.preanim(arguments,2));return this},getRegion:function(){return D.getRegion(this.dom)},getHeight:function(_a4){var h=this.dom.offsetHeight||0;return _a4!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb")},getWidth:function(_a6){var w=this.dom.offsetWidth||0;return _a6!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr")},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle("height"),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth("tb")}}return h},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle("width"),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth("lr")}}return w},getSize:function(_aa){return{width:this.getWidth(_aa),height:this.getHeight(_aa)}},getViewSize:function(){var d=this.dom,doc=document,aw=0,ah=0;if(d==doc||d==doc.body){return{width:D.getViewWidth(),height:D.getViewHeight()}}else{return{width:d.clientWidth,height:d.clientHeight}}},getValue:function(_af){return _af?parseInt(this.dom.value,10):this.dom.value},adjustWidth:function(_b0){if(typeof _b0=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){_b0-=(this.getBorderWidth("lr")+this.getPadding("lr"))}if(_b0<0){_b0=0}}return _b0},adjustHeight:function(_b1){if(typeof _b1=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){_b1-=(this.getBorderWidth("tb")+this.getPadding("tb"))}if(_b1<0){_b1=0}}return _b1},setWidth:function(_b2,_b3){_b2=this.adjustWidth(_b2);if(!_b3||!A){this.dom.style.width=this.addUnits(_b2)}else{this.anim({width:{to:_b2}},this.preanim(arguments,1))}return this},setHeight:function(_b4,_b5){_b4=this.adjustHeight(_b4);if(!_b5||!A){this.dom.style.height=this.addUnits(_b4)}else{this.anim({height:{to:_b4}},this.preanim(arguments,1))}return this},setSize:function(_b6,_b7,_b8){if(typeof _b6=="object"){_b7=_b6.height;_b6=_b6.width}_b6=this.adjustWidth(_b6);_b7=this.adjustHeight(_b7);if(!_b8||!A){this.dom.style.width=this.addUnits(_b6);this.dom.style.height=this.addUnits(_b7)}else{this.anim({width:{to:_b6},height:{to:_b7}},this.preanim(arguments,2))}return this},setBounds:function(x,y,_bb,_bc,_bd){if(!_bd||!A){this.setSize(_bb,_bc);this.setLocation(x,y)}else{_bb=this.adjustWidth(_bb);_bc=this.adjustHeight(_bc);this.anim({points:{to:[x,y]},width:{to:_bb},height:{to:_bc}},this.preanim(arguments,4),"motion")}return this},setRegion:function(_be,_bf){this.setBounds(_be.left,_be.top,_be.right-_be.left,_be.bottom-_be.top,this.preanim(arguments,1));return this},addListener:function(_c0,fn,_c2,_c3){Ext.EventManager.on(this.dom,_c0,fn,_c2||this,_c3)},removeListener:function(_c4,fn){Ext.EventManager.removeListener(this.dom,_c4,fn);return this},removeAllListeners:function(){E.purgeElement(this.dom);return this},relayEvent:function(_c6,_c7){this.on(_c6,function(e){_c7.fireEvent(_c6,e)})},setOpacity:function(_c9,_ca){if(!_ca||!A){var s=this.dom.style;if(Ext.isIE){s.zoom=1;s.filter=(s.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(_c9==1?"":"alpha(opacity="+_c9*100+")")}else{s.opacity=_c9}}else{this.anim({opacity:{to:_c9}},this.preanim(arguments,1),null,0.35,"easeIn")}return this},getLeft:function(_cc){if(!_cc){return this.getX()}else{return parseInt(this.getStyle("left"),10)||0}},getRight:function(_cd){if(!_cd){return this.getX()+this.getWidth()}else{return(this.getLeft(true)+this.getWidth())||0}},getTop:function(_ce){if(!_ce){return this.getY()}else{return parseInt(this.getStyle("top"),10)||0}},getBottom:function(_cf){if(!_cf){return this.getY()+this.getHeight()}else{return(this.getTop(true)+this.getHeight())||0}},position:function(pos,_d1,x,y){if(!pos){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}}else{this.setStyle("position",pos)}if(_d1){this.setStyle("z-index",_d1)}if(x!==undefined&&y!==undefined){this.setXY([x,y])}else{if(x!==undefined){this.setX(x)}else{if(y!==undefined){this.setY(y)}}}},clearPositioning:function(_d4){_d4=_d4||"";this.setStyle({"left":_d4,"right":_d4,"top":_d4,"bottom":_d4,"z-index":"","position":"static"});return this},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return{"position":this.getStyle("position"),"left":l,"right":l?"":this.getStyle("right"),"top":t,"bottom":t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")}},getBorderWidth:function(_d7){return this.addStyles(_d7,El.borders)},getPadding:function(_d8){return this.addStyles(_d8,El.paddings)},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right=""}if(pc.bottom=="auto"){this.dom.style.bottom=""}return this},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block")}}},setLeftTop:function(_da,top){this.dom.style.left=this.addUnits(_da);this.dom.style.top=this.addUnits(top);return this},move:function(_dc,_dd,_de){var xy=this.getXY();_dc=_dc.toLowerCase();switch(_dc){case"l":case"left":this.moveTo(xy[0]-_dd,xy[1],this.preanim(arguments,2));break;case"r":case"right":this.moveTo(xy[0]+_dd,xy[1],this.preanim(arguments,2));break;case"t":case"top":case"up":this.moveTo(xy[0],xy[1]-_dd,this.preanim(arguments,2));break;case"b":case"bottom":case"down":this.moveTo(xy[0],xy[1]+_dd,this.preanim(arguments,2));break}return this},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={"o":this.getStyle("overflow"),"x":this.getStyle("overflow-x"),"y":this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden")}return this},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o)}if(o.x){this.setStyle("overflow-x",o.x)}if(o.y){this.setStyle("overflow-y",o.y)}}return this},getAnchorXY:function(_e1,_e2,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight()}else{w=this.getWidth();h=this.getHeight()}}else{w=s.width;h=s.height}var x=0,y=0,r=Math.round;switch((_e1||"tl").toLowerCase()){case"c":x=r(w*0.5);y=r(h*0.5);break;case"t":x=r(w*0.5);y=0;break;case"l":x=0;y=r(h*0.5);break;case"r":x=w;y=r(h*0.5);break;case"b":x=r(w*0.5);y=h;break;case"tl":x=0;y=0;break;case"bl":x=0;y=h;break;case"br":x=w;y=h;break;case"tr":x=w;y=0;break}if(_e2===true){return[x,y]}if(vp){var sc=this.getScroll();return[x+sc.left,y+sc.top]}var o=this.getXY();return[x+o[0],y+o[1]]},getAlignToXY:function(el,p,o){el=Ext.get(el);var d=this.dom;if(!el.dom){throw"Element.alignTo with an element that doesn't exist"}var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl"}else{if(p=="?"){p="tl-bl?"}else{if(p.indexOf("-")==-1){p="tl-"+p}}}p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p}p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var _102=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var _103=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var doc=document;var _105=(doc.documentElement.scrollLeft||doc.body.scrollLeft||0)+5;var _106=(doc.documentElement.scrollTop||doc.body.scrollTop||0)+5;if((x+w)>dw+_105){x=_103?r.left-w:dw+_105-w}if(x<_105){x=_103?r.right:_105}if((y+h)>dh+_106){y=_102?r.top-h:dh+_106-h}if(y<_106){y=_102?r.bottom:_106}}return[x,y]},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,_109,_10a,_10b){el=Ext.get(el);_10a=_10a?Ext.applyIf(_10a,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Ext.lib.Dom.getViewWidth();vh=Ext.lib.Dom.getViewHeight()}else{vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!_109){var vxy=el.getXY();vx=vxy[0];vy=vxy[1]}}var s=el.getScroll();vx+=_10a.left+s.left;vy+=_10a.top+s.top;vw-=_10a.right;vh-=_10a.bottom;var vr=vx+vw;var vb=vy+vh;var xy=_10b||(!_109?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var _119=false;if((x+w)>vr){x=vr-w;_119=true}if((y+h)>vb){y=vb-h;_119=true}if(x<vx){x=vx;_119=true}if(y<vy){y=vy;_119=true}return _119?[x,y]:false}}(),adjustForConstraints:function(xy,_11b,_11c){return this.getConstrainToXY(_11b||document,false,_11c,xy)||xy},alignTo:function(_11d,_11e,_11f,_120){var xy=this.getAlignToXY(_11d,_11e,_11f);this.setXY(xy,this.preanim(arguments,3));return this},anchorTo:function(el,_123,_124,_125,_126,_127){var _128=function(){this.alignTo(el,_123,_124,_125);Ext.callback(_127,this)};Ext.EventManager.onWindowResize(_128,this);var tm=typeof _126;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",_128,this,{buffer:tm=="number"?_126:50})}_128.call(this);return this},clearOpacity:function(){if(window.ActiveXObject){if(typeof this.dom.style.filter=="string"&&(/alpha/i).test(this.dom.style.filter)){this.dom.style.filter=""}}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]=""}return this},hide:function(_12a){this.setVisible(false,this.preanim(arguments,0));return this},show:function(_12b){this.setVisible(true,this.preanim(arguments,0));return this},addUnits:function(size){return Ext.Element.addUnits(size,this.defaultUnit)},beginMeasure:function(){var el=this.dom;if(el.offsetWidth||el.offsetHeight){return this}var _12e=[];var p=this.dom,b=document.body;while((!el.offsetWidth&&!el.offsetHeight)&&p&&p.tagName&&p!=b){var pe=Ext.get(p);if(pe.getStyle("display")=="none"){_12e.push({el:p,visibility:pe.getStyle("visibility")});p.style.visibility="hidden";p.style.display="block"}p=p.parentNode}this._measureChanged=_12e;return this},endMeasure:function(){var _132=this._measureChanged;if(_132){for(var i=0,len=_132.length;i<len;i++){var r=_132[i];r.el.style.visibility=r.visibility;r.el.style.display="none"}this._measureChanged=null}return this},update:function(html,_137,_138){if(typeof html=="undefined"){html=""}if(_137!==true){this.dom.innerHTML=html;if(typeof _138=="function"){_138()}return this}var id=Ext.id();var dom=this.dom;html+='<span id="'+id+'"></span>';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var _13d=/\ssrc=([\'\"])(.*?)\1/i;var _13e=/\stype=([\'\"])(.*?)\1/i;var _13f;while(_13f=re.exec(html)){var _140=_13f[1];var _141=_140?_140.match(_13d):false;if(_141&&_141[2]){var s=document.createElement("script");s.src=_141[2];var _143=_140.match(_13e);if(_143&&_143[2]){s.type=_143[2]}hd.appendChild(s)}else{if(_13f[2]&&_13f[2].length>0){eval(_13f[2])}}}var el=document.getElementById(id);if(el){el.parentNode.removeChild(el)}if(typeof _138=="function"){_138()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},load:function(){var um=this.getUpdateManager();um.update.apply(um,arguments);return this},getUpdateManager:function(){if(!this.updateManager){this.updateManager=new Ext.UpdateManager(this)}return this.updateManager},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(_146){this.alignTo(_146||document,"c-c");return this},isBorderBox:function(){return _147[this.dom.tagName.toLowerCase()]||Ext.isBorderBox},getBox:function(_148,_149){var xy;if(!_149){xy=this.getXY()}else{var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top]}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!_148){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h}}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)}}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx},getFrameWidth:function(_155,_156){return _156&&Ext.isBorderBox?0:(this.getPadding(_155)+this.getBorderWidth(_155))},setBox:function(box,_158,_159){var w=box.width,h=box.height;if((_158&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"))}this.setBounds(box.x,box.y,w,h,this.preanim(arguments,2));return this},repaint:function(){var dom=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.get(dom).removeClass("x-repaint")},1);return this},getMargins:function(side){if(!side){return{top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0}}else{return this.addStyles(side,El.margins)}},addStyles:function(_15e,_15f){var val=0,v,w;for(var i=0,len=_15e.length;i<len;i++){v=this.getStyle(_15f[_15e.charAt(i)]);if(v){w=parseInt(v,10);if(w){val+=w}}}return val},createProxy:function(_165,_166,_167){if(_166){_166=Ext.getDom(_166)}else{_166=document.body}_165=typeof _165=="object"?_165:{tag:"div",cls:_165};var _168=Ext.DomHelper.append(_166,_165,true);if(_167){_168.setBox(this.getBox())}return _168},mask:function(msg,_16a){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}if(!this._mask){this._mask=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask"},true)}this.addClass("x-masked");this._mask.setDisplayed(true);if(typeof msg=="string"){if(!this._maskMsg){this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg",cn:{tag:"div"}},true)}var mm=this._maskMsg;mm.dom.className=_16a?"ext-el-mask-msg "+_16a:"ext-el-mask-msg";mm.dom.firstChild.innerHTML=msg;mm.setDisplayed(true);mm.center(this)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"){this._mask.setHeight(this.getHeight())}return this._mask},unmask:function(_16c){if(this._mask){if(_16c===true){this._mask.remove();delete this._mask;if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg}}else{this._mask.setDisplayed(false);if(this._maskMsg){this._maskMsg.setDisplayed(false)}}}this.removeClass("x-masked")},isMasked:function(){return this._mask&&this._mask.isVisible()},createShim:function(){var el=document.createElement("iframe");el.frameBorder="no";el.className="ext-shim";if(Ext.isIE&&Ext.isSecure){el.src=Ext.SSL_SECURE_URL}var shim=Ext.get(this.dom.parentNode.insertBefore(el,this.dom));shim.autoBoxAdjust=false;return shim},remove:function(){if(this.dom.parentNode){this.dom.parentNode.removeChild(this.dom)}delete El.cache[this.dom.id]},addClassOnOver:function(_16f,_170){this.on("mouseover",function(){Ext.fly(this,"_internal").addClass(_16f)},this.dom);var _171=function(e){if(_170!==true||!e.within(this,true)){Ext.fly(this,"_internal").removeClass(_16f)}};this.on("mouseout",_171,this.dom);return this},addClassOnFocus:function(_173){this.on("focus",function(){Ext.fly(this,"_internal").addClass(_173)},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(_173)},this.dom);return this},addClassOnClick:function(_174){var dom=this.dom;this.on("mousedown",function(){Ext.fly(dom,"_internal").addClass(_174);var d=Ext.get(document);var fn=function(){Ext.fly(dom,"_internal").removeClass(_174);d.removeListener("mouseup",fn)};d.on("mouseup",fn)});return this},swallowEvent:function(_178,_179){var fn=function(e){e.stopPropagation();if(_179){e.preventDefault()}};if(_178 instanceof Array){for(var i=0,len=_178.length;i<len;i++){this.on(_178[i],fn)}return this}this.on(_178,fn);return this},fitToParentDelegate:Ext.emptyFn,fitToParent:function(_17e,_17f){Ext.EventManager.removeResizeListener(this.fitToParentDelegate);this.fitToParentDelegate=Ext.emptyFn;if(_17e===true&&!this.dom.parentNode){return }var p=Ext.get(_17f||this.dom.parentNode);this.setSize(p.getComputedWidth()-p.getFrameWidth("lr"),p.getComputedHeight()-p.getFrameWidth("tb"));if(_17e===true){this.fitToParentDelegate=this.fitToParent.createDelegate(this,[true,_17f]);Ext.EventManager.onWindowResize(this.fitToParentDelegate)}return this},getNextSibling:function(){var n=this.dom.nextSibling;while(n&&n.nodeType!=1){n=n.nextSibling}return n},getPrevSibling:function(){var n=this.dom.previousSibling;while(n&&n.nodeType!=1){n=n.previousSibling}return n},appendChild:function(el){el=Ext.get(el);el.appendTo(this);return this},createChild:function(_184,_185,_186){_184=_184||{tag:"div"};if(_185){return Ext.DomHelper.insertBefore(_185,_184,_186!==true)}return Ext.DomHelper[!this.dom.firstChild?"overwrite":"append"](this.dom,_184,_186!==true)},appendTo:function(el){el=Ext.getDom(el);el.appendChild(this.dom);return this},insertBefore:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el);return this},insertAfter:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this},insertFirst:function(el,_18b){el=el||{};if(typeof el=="object"&&!el.nodeType){return this.createChild(el,this.dom.firstChild,_18b)}else{el=Ext.getDom(el);this.dom.insertBefore(el,this.dom.firstChild);return !_18b?Ext.get(el):el}},insertSibling:function(el,_18d,_18e){_18d=_18d?_18d.toLowerCase():"before";el=el||{};var rt,_190=_18d=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType){if(_18d=="after"&&!this.dom.nextSibling){rt=Ext.DomHelper.append(this.dom.parentNode,el,!_18e)}else{rt=Ext.DomHelper[_18d=="after"?"insertAfter":"insertBefore"](this.dom,el,!_18e)}}else{rt=this.dom.parentNode.insertBefore(Ext.getDom(el),_18d=="before"?this.dom:this.dom.nextSibling);if(!_18e){rt=Ext.get(rt)}}return rt},wrap:function(_191,_192){if(!_191){_191={tag:"div"}}var _193=Ext.DomHelper.insertBefore(this.dom,_191,!_192);_193.dom?_193.dom.appendChild(this.dom):_193.appendChild(this.dom);return _193},replace:function(el){el=Ext.get(el);this.insertBefore(el);el.remove();return this},insertHtml:function(_195,html,_197){var el=Ext.DomHelper.insertHtml(_195,this.dom,html);return _197?Ext.get(el):el},set:function(o,_19a){var el=this.dom;_19a=typeof _19a=="undefined"?(el.setAttribute?true:false):_19a;for(var attr in o){if(attr=="style"||typeof o[attr]=="function"){continue}if(attr=="cls"){el.className=o["cls"]}else{if(_19a){el.setAttribute(attr,o[attr])}else{el[attr]=o[attr]}}}if(o.style){Ext.DomHelper.applyStyles(el,o.style)}return this},addKeyListener:function(key,fn,_19f){var _1a0;if(typeof key!="object"||key instanceof Array){_1a0={key:key,fn:fn,scope:_19f}}else{_1a0={key:key.key,shift:key.shift,ctrl:key.ctrl,alt:key.alt,fn:fn,scope:_19f}}return new Ext.KeyMap(this,_1a0)},addKeyMap:function(_1a1){return new Ext.KeyMap(this,_1a1)},isScrollable:function(){var dom=this.dom;return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth},scrollTo:function(side,_1a4,_1a5){var prop=side.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!_1a5||!A){this.dom[prop]=_1a4}else{var to=prop=="scrollLeft"?[_1a4,this.dom.scrollTop]:[this.dom.scrollLeft,_1a4];this.anim({scroll:{"to":to}},this.preanim(arguments,2),"scroll")}return this},scroll:function(_1a8,_1a9,_1aa){if(!this.isScrollable()){return }var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;_1a8=_1a8.toLowerCase();var _1b2=false;var a=this.preanim(arguments,2);switch(_1a8){case"l":case"left":if(w-l>cw){var v=Math.min(l+_1a9,w-cw);this.scrollTo("left",v,a);_1b2=true}break;case"r":case"right":if(l>0){var v=Math.max(l-_1a9,0);this.scrollTo("left",v,a);_1b2=true}break;case"t":case"top":case"up":if(t>0){var v=Math.max(t-_1a9,0);this.scrollTo("top",v,a);_1b2=true}break;case"b":case"bottom":case"down":if(h-t>ch){var v=Math.min(t+_1a9,h-ch);this.scrollTo("top",v,a);_1b2=true}break}return _1b2},translatePoints:function(x,y){if(typeof x=="object"||x instanceof Array){y=x[1];x=x[0]}var p=this.getStyle("position");var o=this.getXY();var l=parseInt(this.getStyle("left"),10);var t=parseInt(this.getStyle("top"),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop}return{left:(x-o[0]+l),top:(y-o[1]+t)}},getScroll:function(){var d=this.dom,doc=document;if(d==doc||d==doc.body){var l=window.pageXOffset||doc.documentElement.scrollLeft||doc.body.scrollLeft||0;var t=window.pageYOffset||doc.documentElement.scrollTop||doc.body.scrollTop||0;return{left:l,top:t}}else{return{left:d.scrollLeft,top:d.scrollTop}}},getColor:function(attr,_1c0,_1c1){var v=this.getStyle(attr);if(!v||v=="transparent"||v=="inherit"){return _1c0}var _1c3=typeof _1c1=="undefined"?"#":_1c1;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]).toString(16);if(h<16){h="0"+h}_1c3+=h}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);_1c3+=c+c}}else{if(v.length==7){_1c3+=v.substr(1)}}}}return(_1c3.length>5?_1c3.toLowerCase():_1c0)},boxWrap:function(cls){cls=cls||"x-box";var el=Ext.get(this.insertHtml("beforeBegin",String.format('<div class="{0}">'+El.boxMarkup+"</div>",cls)));el.child("."+cls+"-mc").dom.appendChild(this.dom);return el},getAttributeNS:Ext.isIE?function(ns,name){var d=this.dom;var type=typeof d[ns+":"+name];if(type!="undefined"&&type!="unknown"){return d[ns+":"+name]}return d[name]}:function(ns,name){var d=this.dom;return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name]}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,_1d3){if(v===""||v=="auto"){return v}if(v===undefined){return""}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(_1d3||"px")}return v};El.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var _1d4;El.get=function(el){var ex,elm,id;if(!el){return null}if(typeof el=="string"){if(!(elm=document.getElementById(el))){return null}if(ex=El.cache[el]){ex.dom=elm}else{ex=El.cache[el]=new El(elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=El.cache[id]){ex.dom=el}else{ex=El.cache[id]=new El(el)}return ex}else{if(el instanceof El){if(el!=_1d4){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(el instanceof Array){return El.select(el)}else{if(el==document){if(!_1d4){var f=function(){};f.prototype=El.prototype;_1d4=new f();_1d4.dom=document}return _1d4}}}}}}return null};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;i<len;i++){if(a[i]){delete El.cache[a[i].id||a[i]]}}};El.garbageCollect=function(){if(!Ext.enableGarbageCollector){clearInterval(El.collectorThread);return }for(var eid in El.cache){var el=El.cache[eid],d=el.dom;if(!d||!d.parentNode||(!d.offsetParent&&!document.getElementById(eid))){delete El.cache[eid];if(d&&Ext.enableListenerCollection){E.purgeElement(d)}}}};El.collectorThreadId=setInterval(El.garbageCollect,30000);El.Flyweight=function(dom){this.dom=dom};El.Flyweight.prototype=El.prototype;El._flyweights={};El.fly=function(el,_1e3){_1e3=_1e3||"_global";el=Ext.getDom(el);if(!el){return null}if(!El._flyweights[_1e3]){El._flyweights[_1e3]=new El.Flyweight()}El._flyweights[_1e3].dom=el;return El._flyweights[_1e3]};Ext.get=El.get;Ext.fly=El.fly;var _147=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){_147["button"]=1}Ext.EventManager.on(window,"unload",function(){delete El.cache;delete El._flyweights})})();Ext.enableFx=true;Ext.Fx={slideIn:function(B,C){var A=this.getFxEl();C=C||{};A.queueFx(C,function(){B=B||"t";this.fixDisplay();var D=this.getFxRestore();var I=this.getBox();this.setSize(I);var G=this.fxWrap(D.pos,C,"hidden");var K=this.dom.style;K.visibility="visible";K.position="absolute";var F=function(){A.fxUnwrap(G,D.pos,C);K.width=D.width;K.height=D.height;A.afterFx(C)};var J,L={to:[I.x,I.y]},H={to:I.width},E={to:I.height};switch(B.toLowerCase()){case"t":G.setSize(I.width,0);K.left=K.bottom="0";J={height:E};break;case"l":G.setSize(0,I.height);K.right=K.top="0";J={width:H};break;case"r":G.setSize(0,I.height);G.setX(I.right);K.left=K.top="0";J={width:H,points:L};break;case"b":G.setSize(I.width,0);G.setY(I.bottom);K.left=K.top="0";J={height:E,points:L};break;case"tl":G.setSize(0,0);K.right=K.bottom="0";J={width:H,height:E};break;case"bl":G.setSize(0,0);G.setY(I.y+I.height);K.right=K.top="0";J={width:H,height:E,points:L};break;case"br":G.setSize(0,0);G.setXY([I.right,I.bottom]);K.left=K.top="0";J={width:H,height:E,points:L};break;case"tr":G.setSize(0,0);G.setX(I.x+I.width);K.left=K.bottom="0";J={width:H,height:E,points:L};break}this.dom.style.visibility="visible";G.show();arguments.callee.anim=G.fxanim(J,C,"motion",0.5,"easeOut",F)});return this},slideOut:function(A,C){var B=this.getFxEl();C=C||{};B.queueFx(C,function(){A=A||"t";var I=this.getFxRestore();var D=this.getBox();this.setSize(D);var J=this.fxWrap(I.pos,C,"visible");var F=this.dom.style;F.visibility="visible";F.position="absolute";J.setSize(D);var H=function(){if(C.useDisplay){B.setDisplayed(false)}else{B.hide()}B.fxUnwrap(J,I.pos,C);F.width=I.width;F.height=I.height;B.afterFx(C)};var E,G={to:0};switch(A.toLowerCase()){case"t":F.left=F.bottom="0";E={height:G};break;case"l":F.right=F.top="0";E={width:G};break;case"r":F.left=F.top="0";E={width:G,points:{to:[D.right,D.y]}};break;case"b":F.left=F.top="0";E={height:G,points:{to:[D.x,D.bottom]}};break;case"tl":F.right=F.bottom="0";E={width:G,height:G};break;case"bl":F.right=F.top="0";E={width:G,height:G,points:{to:[D.x,D.bottom]}};break;case"br":F.left=F.top="0";E={width:G,height:G,points:{to:[D.x+D.width,D.bottom]}};break;case"tr":F.left=F.bottom="0";E={width:G,height:G,points:{to:[D.right,D.y]}};break}arguments.callee.anim=J.fxanim(E,C,"motion",0.5,"easeOut",H)});return this},puff:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){this.clearOpacity();this.show();var G=this.getFxRestore();var E=this.dom.style;var F=function(){if(B.useDisplay){A.setDisplayed(false)}else{A.hide()}A.clearOpacity();A.setPositioning(G.pos);E.width=G.width;E.height=G.height;E.fontSize="";A.afterFx(B)};var D=this.getWidth();var C=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(D*2)},height:{to:this.adjustHeight(C*2)},points:{by:[-(D*0.5),-(C*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},B,"motion",0.5,"easeOut",F)});return this},switchOff:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){this.clearOpacity();this.clip();var D=this.getFxRestore();var C=this.dom.style;var E=function(){if(B.useDisplay){A.setDisplayed(false)}else{A.hide()}A.clearOpacity();A.setPositioning(D.pos);C.width=D.width;C.height=D.height;A.afterFx(B)};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},B,"motion",0.3,"easeIn",E)}).defer(100,this)})});return this},highlight:function(C,B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){C=C||"ffff9c";attr=B.attr||"backgroundColor";this.clearOpacity();this.show();var G=this.getColor(attr);var F=this.dom.style[attr];endColor=(B.endColor||G)||"ffffff";var E=function(){A.dom.style[attr]=F;A.afterFx(B)};var D={};D[attr]={from:C,to:endColor};arguments.callee.anim=this.fxanim(D,B,"color",1,"easeIn",E)});return this},frame:function(C,B,D){var A=this.getFxEl();D=D||{};A.queueFx(D,function(){C=C||"#C3DAF9";if(C.length==6){C="#"+C}B=B||1;duration=D.duration||1;this.show();var E=this.getBox();var F=function(){var H=this.createProxy({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+C}});var G=Ext.isBorderBox?2:1;H.animate({top:{from:E.y,to:E.y-20},left:{from:E.x,to:E.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:E.height,to:(E.height+(20*G))},width:{from:E.width,to:(E.width+(20*G))}},duration,function(){H.remove()});if(--B>0){F.defer((duration/2)*1000,this)}else{A.afterFx(D)}};F.call(this)});return this},pause:function(A){var B=this.getFxEl();var C={};B.queueFx(C,function(){setTimeout(function(){B.afterFx(C)},A*1000)});return this},fadeIn:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var C=B.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:C}},B,null,0.5,"easeOut",function(){if(C==1){this.clearOpacity()}A.afterFx(B)})});return this},fadeOut:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){arguments.callee.anim=this.fxanim({opacity:{to:B.endOpacity||0}},B,null,0.5,"easeOut",function(){if(this.visibilityMode==Ext.Element.DISPLAY||B.useDisplay){this.dom.style.display="none"}else{this.dom.style.visibility="hidden"}this.clearOpacity();A.afterFx(B)})});return this},scale:function(A,B,C){this.shift(Ext.apply({},C,{width:A,height:B}));return this},shift:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){var E={},D=B.width,F=B.height,C=B.x,H=B.y,G=B.opacity;if(D!==undefined){E.width={to:this.adjustWidth(D)}}if(F!==undefined){E.height={to:this.adjustHeight(F)}}if(C!==undefined||H!==undefined){E.points={to:[C!==undefined?C:this.getX(),H!==undefined?H:this.getY()]}}if(G!==undefined){E.opacity={to:G}}if(B.xy!==undefined){E.points={to:B.xy}}arguments.callee.anim=this.fxanim(E,B,"motion",0.35,"easeOut",function(){A.afterFx(B)})});return this},ghost:function(A,C){var B=this.getFxEl();C=C||{};B.queueFx(C,function(){A=A||"b";var H=this.getFxRestore();var E=this.getWidth(),G=this.getHeight();var F=this.dom.style;var J=function(){if(C.useDisplay){B.setDisplayed(false)}else{B.hide()}B.clearOpacity();B.setPositioning(H.pos);F.width=H.width;F.height=H.height;B.afterFx(C)};var D={opacity:{to:0},points:{}},I=D.points;switch(A.toLowerCase()){case"t":I.by=[0,-G];break;case"l":I.by=[-E,0];break;case"r":I.by=[E,0];break;case"b":I.by=[0,G];break;case"tl":I.by=[-E,-G];break;case"bl":I.by=[-E,G];break;case"br":I.by=[E,G];break;case"tr":I.by=[E,-G];break}arguments.callee.anim=this.fxanim(D,C,"motion",0.5,"easeOut",J)});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this},nextFx:function(){var A=this.fxQueue[0];if(A){A.call(this)}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0]},stopFx:function(){if(this.hasActiveFx()){var A=this.fxQueue[0];if(A&&A.anim&&A.anim.isAnimated()){this.fxQueue=[A];A.anim.stop(true)}}return this},beforeFx:function(A){if(this.hasActiveFx()&&!A.concurrent){if(A.stopFx){this.stopFx();return true}return false}return true},hasFxBlock:function(){var A=this.fxQueue;return A&&A[0]&&A[0].block},queueFx:function(C,A){if(!this.fxQueue){this.fxQueue=[]}if(!this.hasFxBlock()){Ext.applyIf(C,this.fxDefaults);if(!C.concurrent){var B=this.beforeFx(C);A.block=C.block;this.fxQueue.push(A);if(B){this.nextFx()}}else{A.call(this)}}return this},fxWrap:function(F,D,B){var C;if(!D.wrap||!(C=Ext.get(D.wrap))){var A;if(D.fixPosition){A=this.getXY()}var E=document.createElement("div");E.style.visibility=B;C=Ext.get(this.dom.parentNode.insertBefore(E,this.dom));C.setPositioning(F);if(C.getStyle("position")=="static"){C.position("relative")}this.clearPositioning("auto");C.clip();C.dom.appendChild(this.dom);if(A){C.setXY(A)}}return C},fxUnwrap:function(A,C,B){this.clearPositioning();this.setPositioning(C);if(!B.wrap){A.dom.parentNode.insertBefore(this.dom,A.dom);A.remove()}},getFxRestore:function(){var A=this.dom.style;return{pos:this.getPositioning(),width:A.width,height:A.height}},afterFx:function(A){if(A.afterStyle){this.applyStyles(A.afterStyle)}if(A.afterCls){this.addClass(A.afterCls)}if(A.remove===true){this.remove()}Ext.callback(A.callback,A.scope,[this]);if(!A.concurrent){this.fxQueue.shift();this.nextFx()}},getFxEl:function(){return Ext.get(this.dom)},fxanim:function(G,D,F,E,C,A){F=F||"run";D=D||{};var B=Ext.lib.Anim[F](this.dom,G,(D.duration||E)||0.35,(D.easing||C)||"easeOut",function(){Ext.callback(A,this)},this);D.anim=B;return B}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);Ext.CompositeElement=function(A){this.elements=[];this.addElements(A)};Ext.CompositeElement.prototype={isComposite:true,addElements:function(E){if(!E){return this}if(typeof E=="string"){E=Ext.Element.selectorFunction(E)}var D=this.elements;var C=D.length-1;for(var B=0,A=E.length;B<A;B++){D[++C]=Ext.get(E[B])}return this},fill:function(A){this.elements=[];this.add(A);return this},filter:function(B){var A=[];this.each(function(C){if(C.is(B)){A[A.length]=C.dom}});this.fill(A);return this},invoke:function(D,B){var A=this.elements;for(var C=0,E=A.length;C<E;C++){Ext.Element.prototype[D].apply(A[C],B)}return this},add:function(A){if(typeof A=="string"){this.addElements(Ext.Element.selectorFunction(A))}else{if(A.length!==undefined){this.addElements(A)}else{this.addElements([A])}}return this},each:function(D,E){var C=this.elements;for(var B=0,A=C.length;B<A;B++){if(D.call(E||C[B],C[B],this,B)===false){break}}return this},item:function(A){return this.elements[A]||null},first:function(){return this.item(0)},last:function(){return this.item(this.elements.length-1)},getCount:function(){return this.elements.length},contains:function(A){return this.indexOf(A)!==-1},indexOf:function(A){return this.elements.indexOf(Ext.get(A))},removeElement:function(E,D){if(E instanceof Array){for(var C=0,A=E.length;C<A;C++){this.removeElement(E[C])}return this}var B=typeof E=="number"?E:this.indexOf(E);if(B!==-1){if(D){var F=this.elements[B];if(F.dom){F.remove()}else{F.parentNode.removeChild(F)}}this.elements.splice(B,1)}return this},replaceElement:function(C,B,A){var D=typeof C=="number"?C:this.indexOf(C);if(D!==-1){if(A){this.elements[D].replaceWith(B)}else{this.elements.splice(D,1,Ext.get(B))}}return this},clear:function(){this.elements=[]}};(function(){Ext.CompositeElement.createCall=function(C,B){if(!C[B]){C[B]=function(){return this.invoke(B,arguments)}}};for(var A in Ext.Element.prototype){if(typeof Ext.Element.prototype[A]=="function"){Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,A)}}})();Ext.CompositeElementLite=function(A){Ext.CompositeElementLite.superclass.constructor.call(this,A);this.el=new Ext.Element.Flyweight()};Ext.extend(Ext.CompositeElementLite,Ext.CompositeElement,{addElements:function(E){if(E){if(E instanceof Array){this.elements=this.elements.concat(E)}else{var D=this.elements;var B=D.length-1;for(var C=0,A=E.length;C<A;C++){D[++B]=E[C]}}}return this},invoke:function(F,D){var C=this.elements;var E=this.el;for(var B=0,A=C.length;B<A;B++){E.dom=C[B];Ext.Element.prototype[F].apply(E,D)}return this},item:function(A){if(!this.elements[A]){return null}this.el.dom=this.elements[A];return this.el},addListener:function(B,G,F,E){var D=this.elements;for(var C=0,A=D.length;C<A;C++){Ext.EventManager.on(D[C],B,G,F||D[C],E)}return this},each:function(E,F){var C=this.elements;var D=this.el;for(var B=0,A=C.length;B<A;B++){D.dom=C[B];if(E.call(F||D,D,this,B)===false){break}}return this},indexOf:function(A){return this.elements.indexOf(Ext.getDom(A))},replaceElement:function(D,C,B){var A=typeof D=="number"?D:this.indexOf(D);if(A!==-1){C=Ext.getDom(C);if(B){var E=this.elements[A];E.parentNode.insertBefore(C,E);E.parentNode.removeChild(E)}this.elements.splice(A,1,C)}return this}});Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(D,C,B){var A;if(typeof D=="string"){A=Ext.Element.selectorFunction(D,B)}else{if(D.length!==undefined){A=D}else{throw"Invalid selector"}}if(C===true){return new Ext.CompositeElement(A)}else{return new Ext.CompositeElementLite(A)}};Ext.select=Ext.Element.select;Ext.data.Connection=function(A){Ext.apply(this,A);this.addEvents({"beforerequest":true,"requestcomplete":true,"requestexception":true});Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,request:function(B){if(this.fireEvent("beforerequest",this,B)!==false){var A=B.params;if(typeof A=="function"){A=A.call(B.scope||window,B)}if(typeof A=="object"){A=Ext.urlEncode(B.params)}if(this.extraParams){var I=Ext.urlEncode(this.extraParams);A=A?(A+"&"+I):I}var G=B.url||this.url;if(typeof G=="function"){G=G.call(B.scope||window,B)}if(B.form){var F=Ext.getDom(B.form);G=G||F.action;var E=F.getAttribute("enctype");if(B.isUpload||(E&&E.toLowerCase()=="multipart/form-data")){return this.doFormUpload(B,A,G)}var D=Ext.lib.Ajax.serializeForm(F);A=A?(A+"&"+D):D}var J=B.headers;if(this.defaultHeaders){J=Ext.apply(J||{},this.defaultHeaders);if(!B.headers){B.headers=J}}var C={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:B},timeout:this.timeout};var H=B.method||this.method||(A?"POST":"GET");if(H=="GET"&&(this.disableCaching&&B.disableCaching!==false)||B.disableCaching===true){G+=(G.indexOf("?")!=-1?"&":"?")+"_dc="+(new Date().getTime())}if(typeof B.autoAbort=="boolean"){if(B.autoAbort){this.abort()}}else{if(this.autoAbort!==false){this.abort()}}if((H=="GET"&&A)||B.xmlData){G+=(G.indexOf("?")!=-1?"&":"?")+A;A=""}this.transId=Ext.lib.Ajax.request(H,G,C,A,B);return this.transId}else{Ext.callback(B.callback,B.scope,[B,null,null]);return null}},isLoading:function(A){if(A){return Ext.lib.Ajax.isCallInProgress(A)}else{return this.transId?true:false}},abort:function(A){if(A||this.isLoading()){Ext.lib.Ajax.abort(A||this.transId)}},handleResponse:function(A){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestcomplete",this,A,B);Ext.callback(B.success,B.scope,[A,B]);Ext.callback(B.callback,B.scope,[B,true,A])},handleFailure:function(C,B){this.transId=false;var A=C.argument.options;C.argument=A?A.argument:null;this.fireEvent("requestexception",this,C,A,B);Ext.callback(A.failure,A.scope,[C,A]);Ext.callback(A.callback,A.scope,[A,false,C])},doFormUpload:function(E,A,B){var C=Ext.id();var G=document.createElement("iframe");G.id=C;G.name=C;G.className="x-hidden";if(Ext.isIE){G.src=Ext.SSL_SECURE_URL}document.body.appendChild(G);if(Ext.isIE){document.frames[C].name=C}var F=Ext.getDom(E.form);F.target=C;F.method="POST";F.enctype=F.encoding="multipart/form-data";if(B){F.action=B}var D,K;if(A){D=[];A=Ext.urlDecode(A,false);for(var I in A){if(A.hasOwnProperty(I)){K=document.createElement("input");K.type="hidden";K.name=I;K.value=A[I];F.appendChild(K);D.push(K)}}}function H(){var M={responseText:"",responseXML:null};M.argument=E?E.argument:null;try{var O;if(Ext.isIE){O=G.contentWindow.document}else{O=(G.contentDocument||window.frames[C].document)}if(O&&O.body){M.responseText=O.body.innerHTML}if(O&&O.XMLDocument){M.responseXML=O.XMLDocument}else{M.responseXML=O}}catch(N){}Ext.EventManager.removeListener(G,"load",H,this);this.fireEvent("requestcomplete",this,M,E);Ext.callback(E.success,E.scope,[M,E]);Ext.callback(E.callback,E.scope,[E,true,M]);setTimeout(function(){document.body.removeChild(G)},100)}Ext.EventManager.on(G,"load",H,this);F.submit();if(D){for(var J=0,L=D.length;J<L;J++){F.removeChild(D[J])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(A){return Ext.lib.Ajax.serializeForm(A)}});Ext.UpdateManager=function(A,B){A=Ext.get(A);if(!B&&A.updateManager){return A.updateManager}this.el=A;this.defaultUrl=null;this.addEvents({"beforeupdate":true,"update":true,"failure":true});var C=Ext.UpdateManager.defaults;this.sslBlankUrl=C.sslBlankUrl;this.disableCaching=C.disableCaching;this.indicatorText=C.indicatorText;this.showLoadIndicator=C.showLoadIndicator;this.timeout=C.timeout;this.loadScripts=C.loadScripts;this.transaction=null;this.autoRefreshProcId=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);this.successDelegate=this.processSuccess.createDelegate(this);this.failureDelegate=this.processFailure.createDelegate(this);if(!this.renderer){this.renderer=new Ext.UpdateManager.BasicRenderer()}Ext.UpdateManager.superclass.constructor.call(this)};Ext.extend(Ext.UpdateManager,Ext.util.Observable,{getEl:function(){return this.el},update:function(F,E,D,C){if(this.fireEvent("beforeupdate",this.el,F,E)!==false){var B=this.method,A;if(typeof F=="object"){A=F;F=A.url;E=E||A.params;D=D||A.callback;C=C||A.discardUrl;if(D&&A.scope){D=D.createDelegate(A.scope)}if(typeof A.method!="undefined"){B=A.method}if(typeof A.nocache!="undefined"){this.disableCaching=A.nocache}if(typeof A.text!="undefined"){this.indicatorText='<div class="loading-indicator">'+A.text+"</div>"}if(typeof A.scripts!="undefined"){this.loadScripts=A.scripts}if(typeof A.timeout!="undefined"){this.timeout=A.timeout}}this.showLoading();if(!C){this.defaultUrl=F}if(typeof F=="function"){F=F.call(this)}B=B||(E?"POST":"GET");if(B=="GET"){F=this.prepareUrl(F)}var G=Ext.apply(A||{},{url:F,params:E,success:this.successDelegate,failure:this.failureDelegate,callback:undefined,timeout:(this.timeout*1000),argument:{"url":F,"form":null,"callback":D,"params":E}});this.transaction=Ext.Ajax.request(G)}},formUpdate:function(D,C,B,A){if(this.fireEvent("beforeupdate",this.el,D,C)!==false){if(typeof C=="function"){C=C.call(this)}D=Ext.getDom(D);this.transaction=Ext.Ajax.request({form:D,url:C,success:this.successDelegate,failure:this.failureDelegate,timeout:(this.timeout*1000),argument:{"url":C,"form":D,"callback":A,"reset":B}});this.showLoading.defer(1,this)}},refresh:function(A){if(this.defaultUrl==null){return }this.update(this.defaultUrl,null,A,true)},startAutoRefresh:function(E,A,D,C,B){if(B){this.update(A||this.defaultUrl,D,C,true)}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[A||this.defaultUrl,D,C,true]),E*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText)}},prepareUrl:function(A){if(this.disableCaching){var B="_dc="+(new Date().getTime());if(A.indexOf("?")!==-1){A+="&"+B}else{A+="?"+B}}return A},processSuccess:function(A){this.transaction=null;if(A.argument.form&&A.argument.reset){try{A.argument.form.reset()}catch(B){}}if(this.loadScripts){this.renderer.render(this.el,A,this,this.updateComplete.createDelegate(this,[A]))}else{this.renderer.render(this.el,A,this);this.updateComplete(A)}},updateComplete:function(A){this.fireEvent("update",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback(this.el,true,A)}},processFailure:function(A){this.transaction=null;this.fireEvent("failure",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback(this.el,false,A)}},setRenderer:function(A){this.renderer=A},getRenderer:function(){return this.renderer},setDefaultUrl:function(A){this.defaultUrl=A},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){if(this.transaction){return Ext.Ajax.isLoading(this.transaction)}return false}});Ext.UpdateManager.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>'};Ext.UpdateManager.updateElement=function(E,D,B,A){var C=Ext.get(E,true).getUpdateManager();Ext.apply(C,A);C.update(D,B,A?A.callback:null)};Ext.UpdateManager.update=Ext.UpdateManager.updateElement;Ext.UpdateManager.BasicRenderer=function(){};Ext.UpdateManager.BasicRenderer.prototype={render:function(A,D,C,B){A.update(D.responseText,C.loadScripts,B)}};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(B){if(Date.formatFunctions[B]==null){Date.createNewFormat(B)}var A=Date.formatFunctions[B];return this[A]()};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(_3){var _4="format"+Date.formatFunctions.count++;Date.formatFunctions[_3]=_4;var _5="Date.prototype."+_4+" = function(){return ";var _6=false;var ch="";for(var i=0;i<_3.length;++i){ch=_3.charAt(i);if(!_6&&ch=="\\"){_6=true}else{if(_6){_6=false;_5+="'"+String.escape(ch)+"' + "}else{_5+=Date.getFormatCode(ch)}}}eval(_5.substring(0,_5.length-3)+";}")};Date.getFormatCode=function(A){switch(A){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(A)+"' + "}};Date.parseDate=function(C,B){if(Date.parseFunctions[B]==null){Date.createParser(B)}var A=Date.parseFunctions[B];return Date[A](C)};Date.createParser=function(_d){var _e="parse"+Date.parseFunctions.count++;var _f=Date.parseRegexes.length;var _10=1;Date.parseFunctions[_d]=_e;var _11="Date."+_e+" = function(input){\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+_f+"]);\nif (results && results.length > 0) {";var _12="";var _13=false;var ch="";for(var i=0;i<_d.length;++i){ch=_d.charAt(i);if(!_13&&ch=="\\"){_13=true}else{if(_13){_13=false;_12+=String.escape(ch)}else{var obj=Date.formatCodeToRegex(ch,_10);_10+=obj.g;_12+=obj.s;if(obj.g&&obj.c){_11+=obj.c}}}}_11+="if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{v = new Date(y, m, d, h, i, s);}\nelse if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{v = new Date(y, m, d, h, i);}\nelse if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n{v = new Date(y, m, d, h);}\nelse if (y >= 0 && m >= 0 && d > 0)\n{v = new Date(y, m, d);}\nelse if (y >= 0 && m >= 0)\n{v = new Date(y, m);}\nelse if (y >= 0)\n{v = new Date(y);}\n}return (v && (z || o))?\n    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n;}";Date.parseRegexes[_f]=new RegExp("^"+_12+"$");eval(_11)};Date.formatCodeToRegex=function(B,A){switch(B){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":return{g:1,c:"d = parseInt(results["+A+"], 10);\n",s:"(\\d{1,2})"};case"d":return{g:1,c:"d = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:0,c:null,s:"(?:\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+A+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+A+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":return{g:1,c:"m = parseInt(results["+A+"], 10) - 1;\n",s:"(\\d{1,2})"};case"m":return{g:1,c:"m = parseInt(results["+A+"], 10) - 1;\n",s:"(\\d{2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+A+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+A+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+A+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+A+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":return{g:1,c:"h = parseInt(results["+A+"], 10);\n",s:"(\\d{1,2})"};case"h":case"H":return{g:1,c:"h = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"i":return{g:1,c:"i = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"O":return{g:1,c:["o = results[",A,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n","var mn = o.substring(3,5) % 60;\n","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n","    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"].join(""),s:"([+-]\\d{4})"};case"T":return{g:0,c:null,s:"[A-Z]{1,4}"};case"Z":return{g:1,c:"z = results["+A+"];\nz = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+-]?\\d{1,5})"};default:return{g:0,c:null,s:String.escape(B)}}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1")};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+String.leftPad(this.getTimezoneOffset()%60,2,"0")};Date.prototype.getDayOfYear=function(){var A=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var B=0;B<this.getMonth();++B){A+=Date.daysInMonth[B]}return A+this.getDate()-1};Date.prototype.getWeekOfYear=function(){var C=this.getDayOfYear()+(4-this.getDay());var B=new Date(this.getFullYear(),0,1);var A=(7-B.getDay()+4);return String.leftPad(((C-A)/7)+1,2,"0")};Date.prototype.isLeapYear=function(){var A=this.getFullYear();return((A&3)==0&&(A%100||(A%400==0&&A)))};Date.prototype.getFirstDayOfMonth=function(){var A=(this.getDay()-(this.getDate()-1))%7;return(A<0)?(A+7):A};Date.prototype.getLastDayOfMonth=function(){var A=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(A<0)?(A+7):A};Date.prototype.getFirstDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),1)};Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()]};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.clearTime=function(A){if(A){return this.clone().clearTime()}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};if(Ext.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(A){if(A<=-1){var D=Math.ceil(-A);var C=Math.ceil(D/12);var B=(D%12)?12-D%12:0;this.setFullYear(this.getFullYear()-C);return Date.brokenSetMonth.call(this,B)}else{return Date.brokenSetMonth.apply(this,arguments)}}}Date.MILLI="ms";Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(C,B){var D=this.clone();if(!C||B===0){return D}switch(C.toLowerCase()){case Date.MILLI:D.setMilliseconds(this.getMilliseconds()+B);break;case Date.SECOND:D.setSeconds(this.getSeconds()+B);break;case Date.MINUTE:D.setMinutes(this.getMinutes()+B);break;case Date.HOUR:D.setHours(this.getHours()+B);break;case Date.DAY:D.setDate(this.getDate()+B);break;case Date.MONTH:var A=this.getDate();if(A>28){A=Math.min(A,this.getFirstDateOfMonth().add("mo",B).getLastDateOfMonth().getDate())}D.setDate(A);D.setMonth(this.getMonth()+B);break;case Date.YEAR:D.setFullYear(this.getFullYear()+B);break}return D};Ext.util.DelayedTask=function(C,E,D){var G=null,F,B;var A=function(){var H=new Date().getTime();if(H-B>=F){clearInterval(G);G=null;C.apply(E,D||[])}};this.delay=function(H,K,J,I){if(G&&H!=F){this.cancel()}F=H;B=new Date().getTime();C=K||C;E=J||E;D=I||D;if(!G){G=setInterval(A,F)}};this.cancel=function(){if(G){clearInterval(G);G=null}}};Ext.util.TaskRunner=function(I){I=I||10;var H=[],G=[];var A=0;var F=false;var E=function(){F=false;clearInterval(A);A=0};var D=function(){if(!F){F=true;A=setInterval(C,I)}};var B=function(J){G.push(J);if(J.onStop){J.onStop()}};var C=function(){if(G.length>0){for(var N=0,L=G.length;N<L;N++){H.remove(G[N])}G=[];if(H.length<1){E();return }}var K=new Date().getTime();for(var N=0,L=H.length;N<L;++N){var M=H[N];var O=K-M.taskRunTime;if(M.interval<=O){var J=M.run.apply(M.scope||M,M.args||[++M.taskRunCount]);M.taskRunTime=K;if(J===false||M.taskRunCount===M.repeat){B(M);return }}if(M.duration&&M.duration<=(K-M.taskStartTime)){B(M)}}};this.start=function(J){H.push(J);J.taskStartTime=new Date().getTime();J.taskRunTime=0;J.taskRunCount=0;D();return J};this.stop=function(J){B(J);return J};this.stopAll=function(){E();for(var K=0,J=H.length;K<J;K++){if(H[K].onStop){H[K].onStop()}}H=[];G=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();Ext.util.MixedCollection=function(B,A){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents({"clear":true,"add":true,"replace":true,"remove":true,"sort":true});this.allowFunctions=B===true;if(A){this.getKey=A}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(B,C){if(arguments.length==1){C=arguments[0];B=this.getKey(C)}if(typeof B=="undefined"||B===null){this.length++;this.items.push(C);this.keys.push(null)}else{var A=this.map[B];if(A){return this.replace(B,C)}this.length++;this.items.push(C);this.map[B]=C;this.keys.push(B)}this.fireEvent("add",this.length-1,C,B);return C},getKey:function(A){return A.id},replace:function(B,D){if(arguments.length==1){D=arguments[0];B=this.getKey(D)}var A=this.item(B);if(typeof B=="undefined"||B===null||typeof A=="undefined"){return this.add(B,D)}var C=this.indexOfKey(B);this.items[C]=D;this.map[B]=D;this.fireEvent("replace",B,A,D);return D},addAll:function(C){if(arguments.length>1||C instanceof Array){var B=arguments.length>1?arguments:C;for(var D=0,A=B.length;D<A;D++){this.add(B[D])}}else{for(var E in C){if(this.allowFunctions||typeof C[E]!="function"){this.add(E,C[E])}}}},each:function(C,E){var D=[].concat(this.items);for(var B=0,A=D.length;B<A;B++){if(C.call(E||D[B],D[B],B,A)===false){break}}},eachKey:function(D,C){for(var B=0,A=this.keys.length;B<A;B++){D.call(C||window,this.keys[B],this.items[B],B,A)}},find:function(D,C){for(var B=0,A=this.items.length;B<A;B++){if(D.call(C||window,this.items[B],this.keys[B])){return this.items[B]}}return null},insert:function(A,B,C){if(arguments.length==2){C=arguments[1];B=this.getKey(C)}if(A>=this.length){return this.add(B,C)}this.length++;this.items.splice(A,0,C);if(typeof B!="undefined"&&B!=null){this.map[B]=C}this.keys.splice(A,0,B);this.fireEvent("add",A,C,B);return C},remove:function(A){return this.removeAt(this.indexOf(A))},removeAt:function(A){if(A<this.length&&A>=0){this.length--;var C=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B]}this.keys.splice(A,1);this.fireEvent("remove",C,B)}},removeKey:function(A){return this.removeAt(this.indexOfKey(A))},getCount:function(){return this.length},indexOf:function(C){if(!this.items.indexOf){for(var B=0,A=this.items.length;B<A;B++){if(this.items[B]==C){return B}}return -1}else{return this.items.indexOf(C)}},indexOfKey:function(C){if(!this.keys.indexOf){for(var B=0,A=this.keys.length;B<A;B++){if(this.keys[B]==C){return B}}return -1}else{return this.keys.indexOf(C)}},item:function(A){var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];return typeof B!="function"||this.allowFunctions?B:null},itemAt:function(A){return this.items[A]},key:function(A){return this.map[A]},contains:function(A){return this.indexOf(A)!=-1},containsKey:function(A){return typeof this.map[A]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(I,A,H){var C=String(A).toUpperCase()=="DESC"?-1:1;H=H||function(K,J){return K-J};var G=[],B=this.keys,D=this.items;for(var E=0,F=D.length;E<F;E++){G[G.length]={key:B[E],value:D[E],index:E}}G.sort(function(K,J){var L=H(K[I],J[I])*C;if(L==0){L=(K.index<J.index?-1:1)}return L});for(var E=0,F=G.length;E<F;E++){D[E]=G[E].value;B[E]=G[E].key}this.fireEvent("sort",this)},sort:function(A,B){this._sort("value",A,B)},keySort:function(A,B){this._sort("key",A,B||function(D,C){return String(D).toUpperCase()-String(C).toUpperCase()})},getRange:function(A,B){var E=this.items;if(E.length<1){return[]}A=A||0;B=Math.min(typeof B=="undefined"?this.length-1:B,this.length-1);var D=[];if(A<=B){for(var C=A;C<=B;C++){D[D.length]=E[C]}}else{for(var C=A;C>=B;C--){D[D.length]=E[C]}}return D},filter:function(A,B){if(!B.exec){B=String(B);if(B.length==0){return this.clone()}B=new RegExp("^"+Ext.escapeRe(B),"i")}return this.filterBy(function(C){return C&&B.test(C[A])})},filterBy:function(E,G){var F=new Ext.util.MixedCollection();F.getKey=this.getKey;var B=this.keys,D=this.items;for(var C=0,A=D.length;C<A;C++){if(E.call(G||this,D[C],B[C])){F.add(B[C],D[C])}}return F},clone:function(){var E=new Ext.util.MixedCollection();var B=this.keys,D=this.items;for(var C=0,A=D.length;C<A;C++){E.add(B[C],D[C])}E.getKey=this.getKey;return E}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.util.JSON=new (function(){var _1={}.hasOwnProperty?true:false;var _2=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var _5=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'};var _a=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};var _11=function(o){return'"'+o.getFullYear()+"-"+_2(o.getMonth()+1)+"-"+_2(o.getDate())+"T"+_2(o.getHours())+":"+_2(o.getMinutes())+":"+_2(o.getSeconds())+'"'};this.encode=function(o){if(typeof o=="undefined"||o===null){return"null"}else{if(o instanceof Array){return _a(o)}else{if(o instanceof Date){return _11(o)}else{if(typeof o=="string"){return _5(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!_1||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=function(_18){return eval("("+_18+")")}})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.util.Format=function(){var _1=/^\s+|\s+$/g;return{ellipsis:function(_2,_3){if(_2&&_2.length>_3){return _2.substr(0,_3-3)+"..."}return _2},undef:function(_4){return typeof _4!="undefined"?_4:""},htmlEncode:function(_5){return !_5?_5:String(_5).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(_6){return !_6?_6:String(_6).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},trim:function(_7){return String(_7).replace(_1,"")},substr:function(_8,_9,_a){return String(_8).substr(_9,_a)},lowercase:function(_b){return String(_b).toLowerCase()},uppercase:function(_c){return String(_c).toUpperCase()},capitalize:function(_d){return !_d?_d:_d.charAt(0).toUpperCase()+_d.substr(1).toLowerCase()},call:function(_e,fn){if(arguments.length>2){var _10=Array.prototype.slice.call(arguments,2);_10.unshift(_e);return eval(fn).apply(window,_10)}else{return eval(fn).call(window,_e)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split(".");var _13=ps[0];var sub=ps[1]?"."+ps[1]:".00";var r=/(\d+)(\d{3})/;while(r.test(_13)){_13=_13.replace(r,"$1,$2")}return"$"+_13+sub},date:function(v,_17){if(!v){return""}if(!(v instanceof Date)){v=new Date(Date.parse(v))}return v.dateFormat(_17||"m/d/Y")},dateRenderer:function(_18){return function(v){return Ext.util.Format.date(v,_18)}},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"")}}}();Ext.MasterTemplate=function(){Ext.MasterTemplate.superclass.constructor.apply(this,arguments);this.originalHtml=this.html;var C={};var A,F=this.subTemplateRe;F.lastIndex=0;var E=0;while(A=F.exec(this.html)){var D=A[1],B=A[2];C[E]={name:D,index:E,buffer:[],tpl:new Ext.Template(B)};if(D){C[D]=C[E]}C[E].tpl.compile();C[E].tpl.call=this.call.createDelegate(this);E++}this.subCount=E;this.subs=C};Ext.extend(Ext.MasterTemplate,Ext.Template,{subTemplateRe:/<tpl(?:\sname="([\w-]+)")?>((?:.|\n)*?)<\/tpl>/gi,add:function(B,A){if(arguments.length==1){A=arguments[0];B=0}var C=this.subs[B];C.buffer[C.buffer.length]=C.tpl.apply(A);return this},fill:function(E,C,B){var A=arguments;if(A.length==1||(A.length==2&&typeof A[1]=="boolean")){C=A[0];E=0;B=A[1]}if(B){this.reset()}for(var D=0,F=C.length;D<F;D++){this.add(E,C[D])}return this},reset:function(){var B=this.subs;for(var A=0;A<this.subCount;A++){B[A].buffer=[]}return this},applyTemplate:function(C){var A=this.subs;var B=-1;this.html=this.originalHtml.replace(this.subTemplateRe,function(D,E){return A[++B].buffer.join("")});return Ext.MasterTemplate.superclass.applyTemplate.call(this,C)},apply:function(){return this.applyTemplate.apply(this,arguments)},compile:function(){return this}});Ext.MasterTemplate.prototype.addAll=Ext.MasterTemplate.prototype.fill;Ext.MasterTemplate.from=function(B,A){B=Ext.getDom(B);return new Ext.MasterTemplate(B.value||B.innerHTML,A||"")};Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var P=this.html;P=["<tpl>",P,"</tpl>"].join("");var O=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;var K=/^<tpl\b[^>]*?for="(.*?)"/;var I=/^<tpl\b[^>]*?if="(.*?)"/;var H=/^<tpl\b[^>]*?exec="(.*?)"/;var B,A=0;var E=[];while(B=P.match(O)){var N=B[0].match(K);var M=B[0].match(I);var L=B[0].match(H);var G=null,J=null,F=null;var D=N&&N[1]?N[1]:"";if(M){G=M&&M[1]?M[1]:null;if(G){J=new Function("values","parent","with(values){ return "+(Ext.util.Format.htmlDecode(G))+"; }")}}if(L){G=L&&L[1]?L[1]:null;if(G){F=new Function("values","parent","with(values){ "+(Ext.util.Format.htmlDecode(G))+"; }")}}if(D){switch(D){case".":D=new Function("values","parent","with(values){ return values; }");break;case"..":D=new Function("values","parent","with(values){ return parent; }");break;default:D=new Function("values","parent","with(values){ return "+D+"; }")}}E.push({id:A,target:D,exec:F,test:J,body:B[1]||""});P=P.replace(B[0],"{xtpl"+A+"}");++A}for(var C=E.length-1;C>=0;--C){this.compileTpl(E[C])}this.master=E[E.length-1];this.tpls=E};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,applySubTemplate:function(H,F,E){var D=this.tpls[H];if(D.test&&!D.test.call(this,F,E)){return""}if(D.exec&&D.exec.call(this,F,E)){return""}var G=D.target?D.target.call(this,F,E):F;E=D.target?F:E;if(D.target&&G instanceof Array){var B=[];for(var C=0,A=G.length;C<A;C++){B[B.length]=D.compiled.call(this,G[C],E)}return B.join("")}return D.compiled.call(this,G,E)},compileTpl:function(tpl){var fm=Ext.util.Format;var _1b=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,_1f,_20,_21){if(_1f.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+_1f.substr(4)+", values, parent)"+sep+"'"}var v;if(_1f.indexOf(".")!=-1){v=_1f}else{v="values['"+_1f+"']"}if(_20&&_1b){_21=_21?","+_21:"";if(_20.substr(0,5)!="this."){_20="fm."+_20+"("}else{_20='this.call("'+_20.substr(5)+'", ';_21=", values"}}else{_21="";_20="("+v+" === undefined ? '' : "}return"'"+sep+_20+v+_21+")"+sep+"'"};var _23;if(Ext.isGecko){_23="tpl.compiled = function(values, parent){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{_23=["tpl.compiled = function(values, parent){ return ['"];_23.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));_23.push("'].join('');};");_23=_23.join("")}eval(_23);return this},applyTemplate:function(B){return this.master.compiled.call(this,B,{});var A=this.subs},apply:function(){return this.applyTemplate.apply(this,arguments)},compile:function(){return this}});Ext.XTemplate.from=function(A){A=Ext.getDom(A);return new Ext.XTemplate(A.value||A.innerHTML)};Ext.util.CSS=function(){var D=null;var C=document;var B=/(-[a-z])/gi;var A=function(E,F){return F.charAt(1).toUpperCase()};return{createStyleSheet:function(E,J){var H;var G=C.getElementsByTagName("head")[0];var F=C.createElement("style");F.setAttribute("type","text/css");if(J){F.setAttribute("id",J)}if(Ext.isIE){G.appendChild(F);H=F.styleSheet;H.cssText=E}else{try{F.appendChild(C.createTextNode(E))}catch(I){F.cssText=E}G.appendChild(F);H=F.styleSheet?F.styleSheet:(F.sheet||C.styleSheets[C.styleSheets.length-1])}this.cacheStyleSheet(H);return H},removeStyleSheet:function(F){var E=C.getElementById(F);if(E){E.parentNode.removeChild(E)}},swapStyleSheet:function(G,F){this.removeStyleSheet(G);var E=C.createElement("link");E.setAttribute("rel","stylesheet");E.setAttribute("type","text/css");E.setAttribute("id",G);E.setAttribute("href",F);C.getElementsByTagName("head")[0].appendChild(E)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(F){if(!D){D={}}try{var H=F.cssRules||F.rules;for(var E=H.length-1;E>=0;--E){D[H[E].selectorText]=H[E]}}catch(G){}},getRules:function(G){if(D==null||G){D={};var H=C.styleSheets;for(var F=0,E=H.length;F<E;F++){try{this.cacheStyleSheet(H[F])}catch(I){}}}return D},getRule:function(G,E){var F=this.getRules(E);if(!(G instanceof Array)){return F[G]}for(var H=0;H<G.length;H++){if(F[G[H]]){return F[G[H]]}}return null},updateRule:function(H,G,F){if(!(H instanceof Array)){var E=this.getRule(H);if(E){E.style[G.replace(B,A)]=F;return true}}else{for(var I=0;I<H.length;I++){if(this.updateRule(H[I],G,F)){return true}}}return false}}}();Ext.util.ClickRepeater=function(A,B){this.el=Ext.get(A);this.el.unselectable();Ext.apply(this,B);this.addEvents({"mousedown":true,"click":true,"mouseup":true});this.el.on("mousedown",this.handleMouseDown,this);if(this.preventDefault||this.stopDefault){this.el.on("click",function(C){if(this.preventDefault){C.preventDefault()}if(this.stopDefault){C.stopEvent()}},this)}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)};Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,handleMouseDown:function(){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.get(document).on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.getInterval(),this)},getInterval:function(){if(!this.accelerate){return this.interval}var A=this.mousedownTime.getElapsed();if(A<500){return 400}else{if(A<1700){return 320}else{if(A<2600){return 250}else{if(A<3500){return 180}else{if(A<4400){return 140}else{if(A<5300){return 80}else{if(A<6200){return 50}else{return 10}}}}}}}},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn);this.el.un("mouseout",this.handleMouseOut);Ext.get(document).un("mouseup",this.handleMouseUp);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});Ext.KeyNav=function(A,B){this.el=Ext.get(A);Ext.apply(this,B);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(C){var A=C.getKey();var B=this.keyToHandler[A];if(Ext.isSafari&&B&&A>=37&&A<=40){C.stopEvent()}},relay:function(C){var A=C.getKey();var B=this.keyToHandler[A];if(B&&this[B]){if(this.doRelay(C,this[B],B)!==true){C[this.defaultEventAction]()}}},doRelay:function(C,B,A){return B.call(this.scope||this,C)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isAir){this.el.on("keydown",this.relay,this)}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this)}this.disabled=false}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isAir){this.el.un("keydown",this.relay)}else{this.el.un("keydown",this.prepareEvent);this.el.un("keypress",this.relay)}this.disabled=true}}};Ext.KeyMap=function(A,C,B){this.el=Ext.get(A);this.eventName=B||"keydown";this.bindings=[];if(C){this.addBinding(C)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(K){if(K instanceof Array){for(var B=0,I=K.length;B<I;B++){this.addBinding(K[B])}return }var H=K.key,F=K.shift,D=K.ctrl,M=K.alt,L=K.fn,J=K.scope;if(typeof H=="string"){var N=[];var G=H.toUpperCase();for(var A=0,I=G.length;A<I;A++){N.push(G.charCodeAt(A))}H=N}var E=H instanceof Array;var C=function(R){if((!F||R.shiftKey)&&(!D||R.ctrlKey)&&(!M||R.altKey)){var O=R.getKey();if(E){for(var Q=0,P=H.length;Q<P;Q++){if(H[Q]==O){if(this.stopEvent){R.stopEvent()}L.call(J||window,O,R);return }}}else{if(O==H){if(this.stopEvent){R.stopEvent()}L.call(J||window,O,R)}}}};this.bindings.push(C)},on:function(D,F,C){var B,A,E,G;if(typeof D=="object"&&!(D instanceof Array)){B=D.key;A=D.shift;E=D.ctrl;G=D.alt}else{B=D}this.addBinding({key:B,shift:A,ctrl:E,alt:G,fn:F,scope:C})},handleKeyDown:function(D){if(this.enabled){var B=this.bindings;for(var C=0,A=B.length;C<A;C++){B[C].call(this,D)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}}};Ext.util.TextMetrics=function(){var A;return{measure:function(C,D,B){if(!A){A=Ext.util.TextMetrics.Instance(C,B)}A.bind(C);A.setFixedWidth(B||"auto");return A.getSize(D)},createInstance:function(C,B){return Ext.util.TextMetrics.Instance(C,B)}}}();Ext.util.TextMetrics.Instance=function(B,A){var D=new Ext.Element(document.createElement("div"));document.body.appendChild(D.dom);D.position("absolute");D.setLeftTop(-1000,-1000);D.hide();if(A){D.setWidth(A)}var C={getSize:function(E){D.update(E);var F=D.getSize();D.update("");return F},bind:function(E){D.setStyle(Ext.fly(E).getStyles("font-size","font-style","font-weight","font-family","line-height"))},setFixedWidth:function(E){D.setWidth(E)},getWidth:function(E){D.dom.style.width="auto";return this.getSize(E).width},getHeight:function(E){return this.getSize(E).height}};C.bind(B);return C};Ext.Element.measureText=Ext.util.TextMetrics.measure;Ext.state.Provider=function(){this.addEvents({"statechange":true});this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(B,A){return typeof this.state[B]=="undefined"?A:this.state[B]},clear:function(A){delete this.state[A];this.fireEvent("statechange",this,A,null)},set:function(B,A){this.state[B]=A;this.fireEvent("statechange",this,B,A)},decodeValue:function(E){var J=/^(a|n|d|b|s|o)\:(.*)$/;var C=J.exec(unescape(E));if(!C||!C[1]){return }var B=C[1];var I=C[2];switch(B){case"n":return parseFloat(I);case"d":return new Date(Date.parse(I));case"b":return(I=="1");case"a":var H=[];var G=I.split("^");for(var A=0,D=G.length;A<D;A++){H.push(this.decodeValue(G[A]))}return H;case"o":var H={};var G=I.split("^");for(var A=0,D=G.length;A<D;A++){var F=G[A].split("=");H[F[0]]=this.decodeValue(F[1])}return H;default:return I}},encodeValue:function(C){var B;if(typeof C=="number"){B="n:"+C}else{if(typeof C=="boolean"){B="b:"+(C?"1":"0")}else{if(C instanceof Date){B="d:"+C.toGMTString()}else{if(C instanceof Array){var F="";for(var E=0,A=C.length;E<A;E++){F+=this.encodeValue(C[E]);if(E!=A-1){F+="^"}}B="a:"+F}else{if(typeof C=="object"){var F="";for(var D in C){if(typeof C[D]!="function"){F+=D+"="+this.encodeValue(C[D])+"^"}}B="o:"+F.substring(0,F.length-1)}else{B="s:"+C}}}}}return escape(B)}});Ext.state.Manager=function(){var A=new Ext.state.Provider();return{setProvider:function(B){A=B},get:function(C,B){return A.get(C,B)},set:function(C,B){A.set(C,B)},clear:function(B){A.clear(B)},getProvider:function(){return A}}}();Ext.state.CookieProvider=function(A){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,A);this.state=this.readCookies()};Ext.extend(Ext.state.CookieProvider,Ext.state.Provider,{set:function(B,A){if(typeof A=="undefined"||A===null){this.clear(B);return }this.setCookie(B,A);Ext.state.CookieProvider.superclass.set.call(this,B,A)},clear:function(A){this.clearCookie(A);Ext.state.CookieProvider.superclass.clear.call(this,A)},readCookies:function(){var A={};var F=document.cookie+";";var B=/\s?(.*?)=(.*?);/g;var E;while((E=B.exec(F))!=null){var D=E[1];var C=E[2];if(D&&D.substring(0,3)=="ys-"){A[D.substr(3)]=this.decodeValue(C)}}return A},setCookie:function(B,A){document.cookie="ys-"+B+"="+this.encodeValue(A)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(A){document.cookie="ys-"+A+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")}});(function(){var B=Ext.EventManager;var A=Ext.lib.Dom;Ext.dd.DragDrop=function(E,D,C){if(E){this.init(E,D,C)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(G,F,D){if(typeof F=="number"){F={left:F,right:F,top:F,bottom:F}}F=F||this.defaultPadding;var I=Ext.get(this.getEl()).getBox();var C=Ext.get(G);var L=C.getScroll();var H,E=C.dom;if(E==document.body){H={x:L.left,y:L.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{xy=C.getXY();H={x:xy[0]+L.left,y:xy[1]+L.top,width:E.clientWidth,height:E.clientHeight}}var K=I.y-H.y;var J=I.x-H.x;this.resetConstraints();this.setXConstraint(J-(F.left||0),H.width-J-I.width-(F.right||0));this.setYConstraint(K-(F.top||0),H.height-K-I.height-(F.bottom||0))},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(E,D,C){this.initTarget(E,D,C);B.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(E,D,C){this.config=C||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof E!=="string"){E=Ext.id(E)}this.id=E;this.addToGroup((D)?D:"default");this.handleElId=E;this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(F,E,C,D){if(!E&&0!==E){this.padding=[F,F,F,F]}else{if(!C&&0!==C){this.padding=[F,E,F,E]}else{this.padding=[F,E,C,D]}}},setInitPosition:function(F,D){var G=this.getEl();if(!this.DDM.verifyEl(G)){return }var E=F||0;var C=D||0;var H=A.getXY(G);this.initPageX=H[0]-E;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H)},setStartPosition:function(D){var C=D||A.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1]},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C)},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C]}this.DDM.removeDDFromGroup(this,C)},setDragElId:function(C){this.dragElId=C},setHandleElId:function(C){if(typeof C!=="string"){C=Ext.id(C)}this.handleElId=C;this.DDM.regHandle(this.id,C)},setOuterHandleElId:function(C){if(typeof C!=="string"){C=Ext.id(C)}B.on(C,"mousedown",this.handleMouseDown,this);this.setHandleElId(C);this.hasOuterHandles=true},unreg:function(){B.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(E,D){if(this.primaryButtonOnly&&E.button!=0){return }if(this.isLocked()){return }this.DDM.refreshCache(this.groups);var C=new Ext.lib.Point(Ext.lib.Event.getPageX(E),Ext.lib.Event.getPageY(E));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(C,this)){}else{if(this.clickValidator(E)){this.setStartPosition();this.b4MouseDown(E);this.onMouseDown(E);this.DDM.handleMouseDown(E,this);this.DDM.stopEvent(E)}else{}}},clickValidator:function(D){var C=D.getTarget();return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)))},addInvalidHandleType:function(D){var C=D.toUpperCase();this.invalidHandleTypes[C]=C},addInvalidHandleId:function(C){if(typeof C!=="string"){C=Ext.id(C)}this.invalidHandleIds[C]=C},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C)},removeInvalidHandleType:function(D){var C=D.toUpperCase();delete this.invalidHandleTypes[C]},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=Ext.id(C)}delete this.invalidHandleIds[C]},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E]}}},isValidHandleChild:function(H){var F=true;var E;try{E=H.nodeName.toUpperCase()}catch(G){E=H.nodeName}F=F&&!this.invalidHandleTypes[E];F=F&&!this.invalidHandleIds[H.id];for(var D=0,C=this.invalidHandleClasses.length;F&&D<C;++D){F=!A.hasClass(H,this.invalidHandleClasses[D])}return F},setXTicks:function(F,E){this.xTicks=[];this.xTickSize=E;var C={};for(var D=this.initPageX;D>=this.minX;D=D-E){if(!C[D]){this.xTicks[this.xTicks.length]=D;C[D]=true}}for(D=this.initPageX;D<=this.maxX;D=D+E){if(!C[D]){this.xTicks[this.xTicks.length]=D;C[D]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(D,C){this.yTicks=[];this.yTickSize=C;var F={};for(var E=this.initPageY;E>=this.minY;E=E-C){if(!F[E]){this.yTicks[this.yTicks.length]=E;F[E]=true}}for(E=this.initPageY;E<=this.maxY;E=E+C){if(!F[E]){this.yTicks[this.yTicks.length]=E;F[E]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(E,D,C){this.leftConstraint=E;this.rightConstraint=D;this.minX=this.initPageX-E;this.maxX=this.initPageX+D;if(C){this.setXTicks(this.initPageX,C)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(C,E,D){this.topConstraint=C;this.bottomConstraint=E;this.minY=this.initPageY-C;this.maxY=this.initPageY+E;if(D){this.setYTicks(this.initPageY,D)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(I,H){if(!H){return I}else{if(H[0]>=I){return H[0]}else{for(var G=0,C=H.length;G<C;++G){var F=G+1;if(H[F]&&H[F]>=I){var E=I-H[G];var D=H[F]-I;return(D>E)?H[G]:H[F]}}return H[H.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var A=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(E,C){for(var D in this.ids){for(var B in this.ids[D]){var F=this.ids[D][B];if(!this.isTypeOfDD(F)){continue}F[E].apply(F,C)}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true)},_onResize:function(B){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(B,C){if(!this.initialized){this.init()}if(!this.ids[C]){this.ids[C]={}}this.ids[C][B.id]=B},removeDDFromGroup:function(D,C){if(!this.ids[C]){this.ids[C]={}}var B=this.ids[C];if(B&&B[D.id]){delete B[D.id]}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id]}}delete this.handleIds[C.id]},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={}}this.handleIds[C][B]=B},isDragDrop:function(B){return(this.getDDById(B))?true:false},getRelated:function(F,E){var D=[];for(var C in F.groups){for(j in this.ids[C]){var B=this.ids[C][j];if(!this.isTypeOfDD(B)){continue}if(!E||B.isTarget){D[D.length]=B}}}return D},isLegalTarget:function(F,D){var C=this.getRelated(F,true);for(var E=0,B=C.length;E<B;++E){if(C[E].id==D.id){return true}}return false},isTypeOfDD:function(B){return(B&&B.__ygDragDrop)},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B])},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C]}}return null},handleMouseDown:function(D,C){if(Ext.QuickTips){Ext.QuickTips.disable()}this.currentTarget=D.getTarget();this.dragCurrent=C;var B=C.getEl();this.startX=D.getPageX();this.startY=D.getPageY();this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=Ext.dd.DDM;E.startDrag(E.startX,E.startY)},this.clickTimeThresh)},startDrag:function(B,C){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(B,C);this.dragCurrent.startDrag(B,C)}this.dragThreshMet=true},handleMouseUp:function(B){if(Ext.QuickTips){Ext.QuickTips.enable()}if(!this.dragCurrent){return }clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(B,true)}else{}this.stopDrag(B);this.stopEvent(B)},stopEvent:function(B){if(this.stopPropagation){B.stopPropagation()}if(this.preventDefault){B.preventDefault()}},stopDrag:function(B){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(B);this.dragCurrent.endDrag(B)}this.dragCurrent.onMouseUp(B)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(D){if(!this.dragCurrent){return true}if(Ext.isIE&&(D.button!==0&&D.button!==1&&D.button!==2)){this.stopEvent(D);return this.handleMouseUp(D)}if(!this.dragThreshMet){var C=Math.abs(this.startX-D.getPageX());var B=Math.abs(this.startY-D.getPageY());if(C>this.clickPixelThresh||B>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(D);this.dragCurrent.onDrag(D);if(!this.dragCurrent.moveOnly){this.fireEvents(D,false)}}this.stopEvent(D);return true},fireEvents:function(L,F){var N=this.dragCurrent;if(!N||N.isLocked()){return }var O=L.getPoint();var C=[];var K=[];var J=[];var H=[];var E=[];for(var D in this.dragOvers){var B=this.dragOvers[D];if(!this.isTypeOfDD(B)){continue}if(!this.isOverTarget(O,B,this.mode)){K.push(B)}C[D]=true;delete this.dragOvers[D]}for(var M in N.groups){if("string"!=typeof M){continue}for(D in this.ids[M]){var G=this.ids[M][D];if(!this.isTypeOfDD(G)){continue}if(G.isTarget&&!G.isLocked()&&G!=N){if(this.isOverTarget(O,G,this.mode)){if(F){H.push(G)}else{if(!C[G.id]){E.push(G)}else{J.push(G)}this.dragOvers[G.id]=G}}}}}if(this.mode){if(K.length){N.b4DragOut(L,K);N.onDragOut(L,K)}if(E.length){N.onDragEnter(L,E)}if(J.length){N.b4DragOver(L,J);N.onDragOver(L,J)}if(H.length){N.b4DragDrop(L,H);N.onDragDrop(L,H)}}else{var I=0;for(D=0,I=K.length;D<I;++D){N.b4DragOut(L,K[D].id);N.onDragOut(L,K[D].id)}for(D=0,I=E.length;D<I;++D){N.onDragEnter(L,E[D].id)}for(D=0,I=J.length;D<I;++D){N.b4DragOver(L,J[D].id);N.onDragOver(L,J[D].id)}for(D=0,I=H.length;D<I;++D){N.b4DragDrop(L,H[D].id);N.onDragDrop(L,H[D].id)}}if(F&&!H.length){N.onInvalidDrop(L)}},getBestMatch:function(E){var D=null;var C=E.length;if(C==1){D=E[0]}else{for(var F=0;F<C;++F){var B=E[F];if(B.cursorIsOver){D=B;break}else{if(!D||D.overlap.getArea()<B.overlap.getArea()){D=B}}}}return D},refreshCache:function(F){for(var E in F){if("string"!=typeof E){continue}for(var B in this.ids[E]){var C=this.ids[E][B];if(this.isTypeOfDD(C)){var D=this.getLocation(C);if(D){this.locationCache[C.id]=D}else{delete this.locationCache[C.id]}}}}},verifyEl:function(B){if(B){var D;if(Ext.isIE){try{D=B.offsetParent}catch(C){}}else{D=B.offsetParent}if(D){return true}}return false},getLocation:function(G){if(!this.isTypeOfDD(G)){return null}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=Ext.lib.Dom.getXY(E)}catch(H){}if(!J){return null}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new Ext.lib.Region(M,B,I,F)},isOverTarget:function(J,F,E){var G=this.locationCache[F.id];if(!G||!this.useCache){G=this.getLocation(F);this.locationCache[F.id]=G}if(!G){return false}F.cursorIsOver=G.contains(J);var I=this.dragCurrent;if(!I||!I.getTargetCoord||(!E&&!I.constrainX&&!I.constrainY)){return F.cursorIsOver}F.overlap=null;var H=I.getTargetCoord(J.x,J.y);var D=I.getDragEl();var C=new Ext.lib.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);var B=C.intersect(G);if(B){F.overlap=B;return(E)?true:F.cursorIsOver}else{return false}},_onUnload:function(C,B){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(Ext.getDom(C))}return B},getElement:function(B){return Ext.getDom(B)},getCss:function(C){var B=Ext.getDom(C);return(B)?B.style:null},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style},getPosX:function(B){return Ext.lib.Dom.getX(B)},getPosY:function(B){return Ext.lib.Dom.getY(B)},swapNode:function(D,B){if(D.swapNode){D.swapNode(B)}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B)}else{if(B==D.nextSibling){E.insertBefore(B,D)}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C)}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft}else{if(C){D=C.scrollTop;B=C.scrollLeft}else{}}return{top:D,left:B}},getStyle:function(B,C){return Ext.fly(B).getStyle(C)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(D,C){var B=Ext.lib.Dom.getXY(C);Ext.lib.Dom.setXY(D,B)},numericSort:function(C,B){return(C-B)},_timeoutCount:0,_addListeners:function(){var B=Ext.dd.DDM;if(Ext.lib.Event&&document){B._onLoad()}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true}else{C=C.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(C,B,A){if(C){this.init(C,B,A)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D)},setDelta:function(B,A){this.deltaX=B;this.deltaY=A},setDragElPos:function(B,C){var A=this.getDragEl();this.alignElWithMouse(A,B,C)},alignElWithMouse:function(F,H,G){var E=this.getTargetCoord(H,G);var D=F.dom?F:Ext.fly(F);if(!this.deltaSetXY){var C=[E.x,E.y];D.setXY(C);var B=D.getLeft(true);var A=D.getTop(true);this.deltaSetXY=[B-E.x,A-E.y]}else{D.setLeftTop(E.x+this.deltaSetXY[0],E.y+this.deltaSetXY[1])}this.cachePosition(E.x,E.y);this.autoScroll(E.x,E.y,F.offsetHeight,F.offsetWidth);return E},cachePosition:function(C,B){if(C){this.lastPageX=C;this.lastPageY=B}else{var A=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=A[0];this.lastPageY=A[1]}},autoScroll:function(G,F,D,H){if(this.scroll){var K=Ext.lib.Dom.getViewWidth();var I=Ext.lib.Dom.getViewHeight();var M=this.DDM.getScrollTop();var C=this.DDM.getScrollLeft();var E=D+F;var B=H+G;var A=(K+M-F-this.deltaY);var N=(I+C-G-this.deltaX);var L=40;var J=(document.all)?80:30;if(E>K&&A<L){window.scrollTo(C,M+J)}if(F<M&&M>0&&F-M<L){window.scrollTo(C,M-J)}if(B>I&&N<L){window.scrollTo(C+J,M)}if(G<C&&C>0&&G-C<L){window.scrollTo(C-J,M)}}},getTargetCoord:function(C,B){var A=C-this.deltaX;var D=B-this.deltaY;if(this.constrainX){if(A<this.minX){A=this.minX}if(A>this.maxX){A=this.maxX}}if(this.constrainY){if(D<this.minY){D=this.minY}if(D>this.maxY){D=this.maxY}}A=this.getTick(A,this.xTicks);D=this.getTick(D,this.yTicks);return{x:A,y:D}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(A){this.autoOffset(A.getPageX(),A.getPageY())},b4Drag:function(A){this.setDragElPos(A.getPageX(),A.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(C,B,A){if(C){this.init(C,B,A);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this;var A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame()},50);return }var D=this.getDragEl();if(!D){D=document.createElement("div");D.id=this.dragElId;var C=D.style;C.position="absolute";C.visibility="hidden";C.cursor="move";C.border="2px solid #aaa";C.zIndex=999;A.insertBefore(D,A.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2))}this.setDragElPos(E,D);Ext.fly(A).show()},_resizeProxy:function(){if(this.resizeFrame){var A=this.getEl();Ext.fly(this.getDragEl()).setSize(A.offsetWidth,A.offsetHeight)}},b4MouseDown:function(B){var A=B.getPageX();var C=B.getPageY();this.autoOffset(A,C);this.setDragElPos(A,C)},b4StartDrag:function(A,B){this.showFrame(A,B)},b4EndDrag:function(A){Ext.fly(this.getDragEl()).hide()},endDrag:function(C){var B=this.getEl();var A=this.getDragEl();A.style.visibility="";this.beforeMove();B.style.visibility="hidden";Ext.dd.DDM.moveToEl(B,A);A.style.visibility="hidden";B.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(C,B,A){if(C){this.initTarget(C,B,A)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{toString:function(){return("DDTarget "+this.id)}});Ext.dd.ScrollManager=function(){var J=Ext.dd.DragDropMgr;var I={};var H=null;var G={};var E=function(K){H=null;D()};var B=function(){if(J.dragCurrent){J.refreshCache(J.dragCurrent.groups)}};var A=function(){if(J.dragCurrent){var K=Ext.dd.ScrollManager;if(!K.animate){if(G.el.scroll(G.dir,K.increment)){B()}}else{G.el.scroll(G.dir,K.increment,true,K.animDuration,B)}}};var D=function(){if(G.id){clearInterval(G.id)}G.id=0;G.el=null;G.dir=""};var F=function(L,K){D();G.el=L;G.dir=K;G.id=setInterval(A,Ext.dd.ScrollManager.frequency)};var C=function(P,R){if(R||!J.dragCurrent){return }var K=Ext.dd.ScrollManager;if(!H||H!=J.dragCurrent){H=J.dragCurrent;K.refreshCache()}var O=Ext.lib.Event.getXY(P);var N=new Ext.lib.Point(O[0],O[1]);for(var Q in I){var L=I[Q],M=L._region;if(M&&M.contains(N)&&L.isScrollable()){if(M.bottom-N.y<=K.thresh){if(G.el!=L){F(L,"down")}return }else{if(M.right-N.x<=K.thresh){if(G.el!=L){F(L,"left")}return }else{if(N.y-M.top<=K.thresh){if(G.el!=L){F(L,"up")}return }else{if(N.x-M.left<=K.thresh){if(G.el!=L){F(L,"right")}return }}}}}}D()};J.fireEvents=J.fireEvents.createSequence(C,J);J.stopDrag=J.stopDrag.createSequence(E,J);return{register:function(M){if(M instanceof Array){for(var L=0,K=M.length;L<K;L++){this.register(M[L])}}else{M=Ext.get(M);I[M.id]=M}},unregister:function(M){if(M instanceof Array){for(var L=0,K=M.length;L<K;L++){this.unregister(M[L])}}else{M=Ext.get(M);delete I[M.id]}},thresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,refreshCache:function(){for(var K in I){if(typeof I[K]=="object"){I[K]._region=I[K].getRegion()}}}}}();Ext.dd.Registry=function(){var D={};var C={};var B=0;var A=function(F,E){if(typeof F=="string"){return F}var G=F.id;if(!G&&E!==false){G="extdd-"+(++B);F.id=G}return G};return{register:function(I,E){E=E||{};if(typeof I=="string"){I=document.getElementById(I)}E.ddel=I;D[A(I)]=E;if(E.isHandle!==false){C[E.ddel.id]=E}if(E.handles){var H=E.handles;for(var G=0,F=H.length;G<F;G++){C[A(H[G])]=E}}},unregister:function(H){var J=A(H,false);var I=D[J];if(I){delete D[J];if(I.handles){var G=I.handles;for(var F=0,E=G.length;F<E;F++){delete C[A(G[F],false)]}}}},getHandle:function(E){if(typeof E!="string"){E=E.id}return C[E]},getHandleFromEvent:function(F){var E=Ext.lib.Event.getTarget(F);return E?C[E.id]:null},getTarget:function(E){if(typeof E!="string"){E=E.id}return D[E]},getTargetFromEvent:function(F){var E=Ext.lib.Event.getTarget(F);return E?D[E.id]||C[E.id]:null}}}();Ext.dd.StatusProxy=function(A){Ext.apply(this,A);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!A||A.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(A){A=A||this.dropNotAllowed;if(this.dropStatus!=A){this.el.replaceClass(this.dropStatus,A);this.dropStatus=A}},reset:function(A){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(A){this.ghost.update("")}},update:function(A){if(typeof A=="string"){this.ghost.update(A)}else{this.ghost.update("");A.style.margin="0";this.ghost.dom.appendChild(A)}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(A){this.el.hide();if(A){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(C,B,A){this.callback=B;this.scope=A;if(C&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:C,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null}};Ext.dd.DragSource=function(A,B){this.el=Ext.get(A);this.dragData={};Ext.apply(this,B);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(A){return this.dragData},onDragEnter:function(C,D){var B=Ext.dd.DragDropMgr.getDDById(D);this.cachedTarget=B;if(this.beforeDragEnter(B,C,D)!==false){if(B.isNotifyTarget){var A=B.notifyEnter(this,C,this.dragData);this.proxy.setStatus(A)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(B,C,D)}}},beforeDragEnter:function(A,B,C){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(C,D){var B=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(D);if(this.beforeDragOver(B,C,D)!==false){if(B.isNotifyTarget){var A=B.notifyOver(this,C,this.dragData);this.proxy.setStatus(A)}if(this.afterDragOver){this.afterDragOver(B,C,D)}}},beforeDragOver:function(C,A,B){return true},onDragOut:function(B,C){var A=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(C);if(this.beforeDragOut(A,B,C)!==false){if(A.isNotifyTarget){A.notifyOut(this,B,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(A,B,C)}}this.cachedTarget=null},beforeDragOut:function(A,B,C){return true},onDragDrop:function(B,C){var A=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(C);if(this.beforeDragDrop(A,B,C)!==false){if(A.isNotifyTarget){if(A.notifyDrop(this,B,this.dragData)){this.onValidDrop(A,B,C)}else{this.onInvalidDrop(A,B,C)}}else{this.onValidDrop(A,B,C)}if(this.afterDragDrop){this.afterDragDrop(A,B,C)}}},beforeDragDrop:function(A,B,C){return true},onValidDrop:function(A,B,C){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(A,B,C)}},getRepairXY:function(A,B){return this.el.getXY()},onInvalidDrop:function(B,A,C){this.beforeInvalidDrop(B,A,C);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,A,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(A,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(A,C)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(A,B,C){return true},handleMouseDown:function(B){if(this.dragging){return }var A=this.getDragData(B);if(A&&this.onBeforeDrag(A,B)!==false){this.dragData=A;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(A,B){return true},onStartDrag:Ext.emptyFn,startDrag:function(A,B){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(A,B);this.proxy.show()},onInitDrag:function(A,C){var B=this.el.dom.cloneNode(true);B.id=Ext.id();this.proxy.update(B);this.onStartDrag(A,C);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(A){},endDrag:function(A){this.onEndDrag(this.dragData,A)},onEndDrag:function(B,A){},autoOffset:function(A,B){this.setDelta(-12,-20)}});Ext.dd.DropTarget=function(A,B){this.el=Ext.get(A);Ext.apply(this,B);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})};Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(A,C,B){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(A,C,B){return this.dropAllowed},notifyOut:function(A,C,B){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(B,C,A){return false}});Ext.dd.DragZone=function(A,B){Ext.dd.DragZone.superclass.constructor.call(this,A,B);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}};Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(A){return Ext.dd.Registry.getHandleFromEvent(A)},onInitDrag:function(A,B){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(A,B);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(A){return Ext.Element.fly(this.dragData.ddel).getXY()}});Ext.dd.DropZone=function(A,B){Ext.dd.DropZone.superclass.constructor.call(this,A,B)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(A){return Ext.dd.Registry.getTargetFromEvent(A)},onNodeEnter:function(D,A,C,B){},onNodeOver:function(D,A,C,B){return this.dropAllowed},onNodeOut:function(D,A,B,C){},onNodeDrop:function(D,A,C,B){return false},onContainerOver:function(A,C,B){return this.dropNotAllowed},onContainerDrop:function(A,C,B){return false},notifyEnter:function(A,C,B){return this.dropNotAllowed},notifyOver:function(B,C,A){var D=this.getTargetFromEvent(C);if(!D){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,B,C,A);this.lastOverNode=null}return this.onContainerOver(B,C,A)}if(this.lastOverNode!=D){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,B,C,A)}this.onNodeEnter(D,B,C,A);this.lastOverNode=D}return this.onNodeOver(D,B,C,A)},notifyOut:function(A,B,C){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,A,B,C);this.lastOverNode=null}},notifyDrop:function(A,C,B){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,A,C,B);this.lastOverNode=null}var D=this.getTargetFromEvent(C);return D?this.onNodeDrop(D,A,C,B):this.onContainerDrop(A,C,B)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.data.SortTypes={none:function(A){return A},stripTagsRE:/<\/?[^>]+>/gi,asText:function(A){return String(A).replace(this.stripTagsRE,"")},asUCText:function(A){return String(A).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(A){return String(A).toUpperCase()},asDate:function(A){if(!A){return 0}if(A instanceof Date){return A.getTime()}return Date.parse(String(A))},asFloat:function(B){var A=parseFloat(String(B).replace(/,/g,""));if(isNaN(A)){A=0}return A},asInt:function(B){var A=parseInt(String(B).replace(/,/g,""));if(isNaN(A)){A=0}return A}};Ext.data.Record=function(A,B){this.id=(B||B===0)?B:++Ext.data.Record.AUTO_ID;this.data=A};Ext.data.Record.create=function(E){var C=function(){C.superclass.constructor.apply(this,arguments)};Ext.extend(C,Ext.data.Record);var D=C.prototype;D.fields=new Ext.util.MixedCollection(false,function(F){return F.name});for(var B=0,A=E.length;B<A;B++){D.fields.add(new Ext.data.Field(E[B]))}C.getField=function(F){return D.fields.get(F)};return C};Ext.data.Record.AUTO_ID=1000;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(A){this.store=A},set:function(B,A){if(this.data[B]==A){return }this.dirty=true;if(!this.modified){this.modified={}}if(typeof this.modified[B]=="undefined"){this.modified[B]=this.data[B]}this.data[B]=A;if(!this.editing){this.store.afterEdit(this)}},get:function(A){return this.data[A]},beginEdit:function(){this.editing=true;this.modified={}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this)}},reject:function(){var A=this.modified;for(var B in A){if(typeof A[B]!="function"){this.data[B]=A[B]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterReject(this)}},commit:function(){this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterCommit(this)}},hasError:function(){return this.error!=null},clearError:function(){this.error=null},copy:function(A){return new this.constructor(Ext.apply({},this.data),A||this.id)}};Ext.data.Store=function(A){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(B){return B.id};this.baseParams={};this.paramNames={"start":"start","limit":"limit","sort":"sort","dir":"dir"};if(A&&A.data){this.inlineData=A.data;delete A.data}Ext.apply(this,A);if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this)}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents({datachanged:true,metachange:true,add:true,remove:true,update:true,clear:true,beforeload:true,load:true,loadexception:true});if(this.proxy){this.relayEvents(this.proxy,["loadexception"])}this.sortToggle={};Ext.data.Store.superclass.constructor.call(this);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,add:function(D){D=[].concat(D);for(var C=0,B=D.length;C<B;C++){D[C].join(this)}var A=this.data.length;this.data.addAll(D);this.fireEvent("add",this,D,A)},remove:function(B){var A=this.data.indexOf(B);this.data.removeAt(A);if(this.pruneModifiedRecords){this.modified.remove(B)}this.fireEvent("remove",this,B,A)},removeAll:function(){this.data.clear();if(this.pruneModifiedRecords){this.modified=[]}this.fireEvent("clear",this)},insert:function(A,D){D=[].concat(D);for(var C=0,B=D.length;C<B;C++){this.data.insert(A,D[C]);D[C].join(this)}this.fireEvent("add",this,D,A)},indexOf:function(A){return this.data.indexOf(A)},indexOfId:function(A){return this.data.indexOfKey(A)},getById:function(A){return this.data.key(A)},getAt:function(A){return this.data.itemAt(A)},getRange:function(B,A){return this.data.getRange(B,A)},storeOptions:function(A){A=Ext.apply({},A);delete A.callback;delete A.scope;this.lastOptions=A},load:function(B){B=B||{};if(this.fireEvent("beforeload",this,B)!==false){this.storeOptions(B);var C=Ext.apply(B.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var A=this.paramNames;C[A["sort"]]=this.sortInfo.field;C[A["dir"]]=this.sortInfo.direction}this.proxy.load(C,this.reader,this.loadRecords,this,B)}},reload:function(A){this.load(Ext.applyIf(A||{},this.lastOptions))},loadRecords:function(G,B,E){if(!G||E===false){if(E!==false){this.fireEvent("load",this,[],B)}if(B.callback){B.callback.call(B.scope||this,[],B,false)}return }var F=G.records,D=G.totalRecords||F.length;if(!B||B.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var C=0,A=F.length;C<A;C++){F[C].join(this)}this.data.clear();this.data.addAll(F);this.totalLength=D;this.applySort();this.fireEvent("datachanged",this)}else{this.totalLength=Math.max(D,this.data.length+F.length);this.add(F)}this.fireEvent("load",this,F,B);if(B.callback){B.callback.call(B.scope||this,F,B,true)}},loadData:function(C,A){var B=this.reader.readRecords(C);this.loadRecords(B,{add:A},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if(this.sortInfo&&!this.remoteSort){var C=this.sortInfo,D=C.field;var A=this.fields.get(D).sortType;var B=function(F,E){var H=A(F.data[D]),G=A(E.data[D]);return H>G?1:(H<G?-1:0)};this.data.sort(C.direction,B);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(C.direction,B)}}},setDefaultSort:function(B,A){this.sortInfo={field:B,direction:A?A.toUpperCase():"ASC"}},sort:function(B,A){var C=this.fields.get(B);if(!A){if(this.sortInfo&&this.sortInfo.field==C.name){A=(this.sortToggle[C.name]||"ASC").toggle("ASC","DESC")}else{A=C.sortDir}}this.sortToggle[C.name]=A;this.sortInfo={field:C.name,direction:A};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{this.load(this.lastOptions)}},each:function(B,A){this.data.each(B,A)},getModifiedRecords:function(){return this.modified},createFilterFn:function(C,B,A){if(!B.exec){B=String(B);if(B.length==0){return false}B=new RegExp((A===true?"":"^")+Ext.escapeRe(B),"i")}return function(D){return B.test(D.data[C])}},sum:function(F,E,A){var C=this.data.items,B=0;E=E||0;A=(A||A===0)?A:C.length-1;for(var D=E;D<=A;D++){B+=(C[D].data[F]||0)}return B},filter:function(D,C,B){var A=this.createFilterFn(D,C,B);return A?this.filterBy(A):this.clearFilter()},filterBy:function(B,A){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(B,A||this);this.fireEvent("datachanged",this)},query:function(C,B,A){var D=this.createFilterFn(C,B,A);return D?this.queryBy(D):this.data.clone()},queryBy:function(A,C){var B=this.snapshot||this.data;return B.filterBy(A,C||this)},collect:function(C,B,E){var H=(E===true&&this.snapshot)?this.snapshot.items:this.data.items;var I,J,A=[],D={};for(var F=0,G=H.length;F<G;F++){I=H[F].data[C];J=String(I);if((B||!Ext.isEmpty(I))&&!D[J]){D[J]=true;A[A.length]=I}}return A},clearFilter:function(A){if(this.snapshot&&this.snapshot!=this.data){this.data=this.snapshot;delete this.snapshot;if(A!==true){this.fireEvent("datachanged",this)}}},afterEdit:function(A){if(this.modified.indexOf(A)==-1){this.modified.push(A)}this.fireEvent("update",this,A,Ext.data.Record.EDIT)},afterReject:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Ext.data.Record.REJECT)},afterCommit:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Ext.data.Record.COMMIT)},commitChanges:function(){var B=this.modified.slice(0);this.modified=[];for(var C=0,A=B.length;C<A;C++){B[C].commit()}},rejectChanges:function(){var B=this.modified.slice(0);this.modified=[];for(var C=0,A=B.length;C<A;C++){B[C].reject()}},onMetaChange:function(A,C,B){this.recordType=C;this.fields=C.prototype.fields;delete this.snapshot;this.sortInfo=A.sortInfo;this.modified=[];this.fireEvent("metachange",this,this.reader.meta)}});Ext.data.SimpleStore=function(A){Ext.data.SimpleStore.superclass.constructor.call(this,{reader:new Ext.data.ArrayReader({id:A.id},Ext.data.Record.create(A.fields)),proxy:new Ext.data.MemoryProxy(A.data)});this.load()};Ext.extend(Ext.data.SimpleStore,Ext.data.Store);Ext.data.JsonStore=function(A){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(A,{proxy:!A.data?new Ext.data.HttpProxy({url:A.url}):undefined,reader:new Ext.data.JsonReader(A,A.fields)}))};Ext.extend(Ext.data.JsonStore,Ext.data.Store);Ext.data.Field=function(E){if(typeof E=="string"){E={name:E}}Ext.apply(this,E);if(!this.type){this.type="auto"}var B=Ext.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=B[this.sortType]}if(!this.sortType){switch(this.type){case"string":this.sortType=B.asUCString;break;case"date":this.sortType=B.asDate;break;default:this.sortType=B.none}}var D=/[\$,%]/g;if(!this.convert){var A,C=this.dateFormat;switch(this.type){case"":case"auto":case undefined:A=function(F){return F};break;case"string":A=function(F){return(F===undefined||F===null)?"":String(F)};break;case"int":A=function(F){return F!==undefined&&F!==null&&F!==""?parseInt(String(F).replace(D,""),10):""};break;case"float":A=function(F){return F!==undefined&&F!==null&&F!==""?parseFloat(String(F).replace(D,""),10):""};break;case"bool":case"boolean":A=function(F){return F===true||F==="true"||F==1};break;case"date":A=function(G){if(!G){return""}if(G instanceof Date){return G}if(C){if(C=="timestamp"){return new Date(G*1000)}return Date.parseDate(G,C)}var F=Date.parse(G);return F?new Date(F):null};break}this.convert=A}};Ext.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};Ext.data.DataReader=function(B,A){this.meta=B;this.recordType=A instanceof Array?Ext.data.Record.create(A):A};Ext.data.DataReader.prototype={};Ext.data.DataProxy=function(){this.addEvents({beforeload:true,load:true,loadexception:true});Ext.data.DataProxy.superclass.constructor.call(this)};Ext.extend(Ext.data.DataProxy,Ext.util.Observable);Ext.data.MemoryProxy=function(A){Ext.data.MemoryProxy.superclass.constructor.call(this);this.data=A};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{load:function(F,E,D,C,B){F=F||{};var A;try{A=E.readRecords(this.data)}catch(G){this.fireEvent("loadexception",this,B,null,G);D.call(C,null,B,false);return }D.call(C,A,B,true)},update:function(B,A){}});Ext.data.HttpProxy=function(A){Ext.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},load:function(E,D,C,B,A){if(this.fireEvent("beforeload",this,E)!==false){var F={params:E||{},request:{callback:C,scope:B,arg:A},reader:D,callback:this.loadResponse,scope:this};if(this.useAjax){Ext.applyIf(F,this.conn);if(this.activeRequest){Ext.Ajax.abort(this.activeRequest)}this.activeRequest=Ext.Ajax.request(F)}else{this.conn.request(F)}}else{C.call(B||this,null,A,false)}},loadResponse:function(E,A,C){delete this.activeRequest;if(!A){this.fireEvent("loadexception",this,E,C);E.request.callback.call(E.request.scope,null,E.request.arg,false);return }var B;try{B=E.reader.read(C)}catch(D){this.fireEvent("loadexception",this,E,C,D);E.request.callback.call(E.request.scope,null,E.request.arg,false);return }this.fireEvent("load",this,E,E.request.arg);E.request.callback.call(E.request.scope,B,E.request.arg,true)},update:function(A){},updateResponse:function(A){}});Ext.data.ScriptTagProxy=function(A){Ext.data.ScriptTagProxy.superclass.constructor.call(this);Ext.apply(this,A);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(K,J,H,F,E){if(this.fireEvent("beforeload",this,K)!==false){var A=Ext.urlEncode(Ext.apply(K,this.extraParams));var C=this.url;C+=(C.indexOf("?")!=-1?"&":"?")+A;if(this.nocache){C+="&_dc="+(new Date().getTime())}var B=++Ext.data.ScriptTagProxy.TRANS_ID;var I={id:B,cb:"stcCallback"+B,scriptId:"stcScript"+B,params:K,arg:E,url:C,callback:H,scope:F,reader:J};var G=this;window[I.cb]=function(L){G.handleResponse(L,I)};C+=String.format("&{0}={1}",this.callbackParam,I.cb);if(this.autoAbort!==false){this.abort()}I.timeoutId=this.handleFailure.defer(this.timeout,this,[I]);var D=document.createElement("script");D.setAttribute("src",C);D.setAttribute("type","text/javascript");D.setAttribute("id",I.scriptId);this.head.appendChild(D);this.trans=I}else{H.call(F||this,null,E,false)}},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(A,C){this.head.removeChild(document.getElementById(A.scriptId));clearTimeout(A.timeoutId);if(C){window[A.cb]=undefined;try{delete window[A.cb]}catch(B){}}else{window[A.cb]=function(){window[A.cb]=undefined;try{delete window[A.cb]}catch(D){}}}},handleResponse:function(D,C){this.trans=false;this.destroyTrans(C,true);var B;try{B=C.reader.readRecords(D)}catch(A){this.fireEvent("loadexception",this,D,C.arg,A);C.callback.call(C.scope||window,null,C.arg,false);return }this.fireEvent("load",this,D,C.arg);C.callback.call(C.scope||window,B,C.arg,true)},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false)}});Ext.data.JsonReader=function(B,A){B=B||{};Ext.data.JsonReader.superclass.constructor.call(this,B,A||B.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(_3){var _4=_3.responseText;var o=eval("("+_4+")");if(!o){throw {message:"JsonReader.read: Json object not found"}}if(o.metaData){delete this.ef;this.meta=o.metaData;this.recordType=Ext.data.Record.create(o.metaData.fields);this.onMetaChange(this.meta,this.recordType,o)}return this.readRecords(o)},onMetaChange:function(B,A,C){},simpleAccess:function(A,B){return A[B]},getJsonAccessor:function(){var A=/[\[\.]/;return function(B){try{return(A.test(B))?new Function("obj","return obj."+B):function(D){return D[B]}}catch(C){}return Ext.emptyFn}}(),readRecords:function(M){this.jsonData=M;var K=this.meta,E=this.recordType,R=E.prototype.fields,H=R.items,F=R.length;if(!this.ef){if(K.totalProperty){this.getTotal=this.getJsonAccessor(K.totalProperty)}if(K.successProperty){this.getSuccess=this.getJsonAccessor(K.successProperty)}this.getRoot=K.root?this.getJsonAccessor(K.root):function(U){return U};if(K.id){var Q=this.getJsonAccessor(K.id);this.getId=function(V){var U=Q(V);return(U===undefined||U==="")?null:U}}else{this.getId=function(){return null}}this.ef=[];for(var P=0;P<F;P++){R=H[P];var T=(R.mapping!==undefined&&R.mapping!==null)?R.mapping:R.name;this.ef[P]=this.getJsonAccessor(T)}}var D=this.getRoot(M),S=D.length,C=S,B=true;if(K.totalProperty){var I=parseInt(this.getTotal(M),10);if(!isNaN(I)){C=I}}if(K.successProperty){var I=this.getSuccess(M);if(I===false||I==="false"){B=false}}var A=[];for(var P=0;P<S;P++){var N=D[P];var J={};var L=this.getId(N);for(var O=0;O<F;O++){R=H[O];var I=this.ef[O](N);J[R.name]=R.convert((I!==undefined)?I:R.defaultValue)}var G=new E(J,L);G.json=N;A[P]=G}return{success:B,records:A,totalRecords:C}}});Ext.data.XmlReader=function(B,A){B=B||{};Ext.data.XmlReader.superclass.constructor.call(this,B,A||B.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(B){var A=B.responseXML;if(!A){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(A)},readRecords:function(H){this.xmlData=H;var F=H.documentElement||H;var M=Ext.DomQuery;var D=this.recordType,C=D.prototype.fields;var K=this.meta.id;var J=0,I=true;if(this.meta.totalRecords){J=M.selectNumber(this.meta.totalRecords,F,0)}if(this.meta.success){var O=M.selectValue(this.meta.success,F,true);I=O!==false&&O!=="false"}var G=[];var U=M.select(this.meta.record,F);for(var R=0,S=U.length;R<S;R++){var P=U[R];var E={};var N=K?M.selectValue(K,P):undefined;for(var Q=0,B=C.length;Q<B;Q++){var T=C.items[Q];var L=M.selectValue(T.mapping||T.name,P,T.defaultValue);L=T.convert(L);E[T.name]=L}var A=new D(E,N);A.node=P;G[G.length]=A}return{success:I,records:G,totalRecords:J||G.length}}});Ext.data.ArrayReader=function(B,A){Ext.data.ArrayReader.superclass.constructor.call(this,B,A)};Ext.extend(Ext.data.ArrayReader,Ext.data.JsonReader,{readRecords:function(B){var O=this.meta?this.meta.id:null;var M=this.recordType,L=M.prototype.fields;var K=[];var H=B;for(var G=0;G<H.length;G++){var C=H[G];var N={};var A=((O||O===0)&&C[O]!==undefined&&C[O]!==""?C[O]:null);for(var E=0,J=L.length;E<J;E++){var I=L.items[E];var D=I.mapping!==undefined&&I.mapping!==null?I.mapping:E;var P=C[D]!==undefined?C[D]:I.defaultValue;P=I.convert(P);N[I.name]=P}var F=new M(N,A);F.json=C;K[K.length]=F}return{records:K,totalRecords:K.length}}});Ext.data.Tree=function(A){this.nodeHash={};this.root=null;if(A){this.setRootNode(A)}this.addEvents({"append":true,"remove":true,"move":true,"insert":true,"beforeappend":true,"beforeremove":true,"beforemove":true,"beforeinsert":true});Ext.data.Tree.superclass.constructor.call(this)};Ext.extend(Ext.data.Tree,Ext.util.Observable,{pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(A){this.root=A;A.ownerTree=this;A.isRoot=true;this.registerNode(A);return A},getNodeById:function(A){return this.nodeHash[A]},registerNode:function(A){this.nodeHash[A.id]=A},unregisterNode:function(A){delete this.nodeHash[A.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=function(A){this.attributes=A||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"ynode-");this.attributes.id=this.id}this.childNodes=[];if(!this.childNodes.indexOf){this.childNodes.indexOf=function(D){for(var C=0,B=this.length;C<B;C++){if(this[C]==D){return C}}return -1}}this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({"append":true,"remove":true,"move":true,"insert":true,"beforeappend":true,"beforeremove":true,"beforemove":true,"beforeinsert":true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)};Ext.extend(Ext.data.Node,Ext.util.Observable,{fireEvent:function(A){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var B=this.getOwnerTree();if(B){if(B.proxyNodeEvent.apply(B,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(A){this.firstChild=A},setLastChild:function(A){this.lastChild=A},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},appendChild:function(B){var G=false;if(B instanceof Array){G=B}else{if(arguments.length>1){G=arguments}}if(G){for(var C=0,A=G.length;C<A;C++){this.appendChild(G[C])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,B)===false){return false}var E=this.childNodes.length;var D=B.parentNode;if(D){if(B.fireEvent("beforemove",B.getOwnerTree(),B,D,this,E)===false){return false}D.removeChild(B)}E=this.childNodes.length;if(E==0){this.setFirstChild(B)}this.childNodes.push(B);B.parentNode=this;var F=this.childNodes[E-1];if(F){B.previousSibling=F;F.nextSibling=B}else{B.previousSibling=null}B.nextSibling=null;this.setLastChild(B);B.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,B,E);if(D){B.fireEvent("move",this.ownerTree,B,D,this,E)}return B}},removeChild:function(B){var A=this.childNodes.indexOf(B);if(A==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,B)===false){return false}this.childNodes.splice(A,1);if(B.previousSibling){B.previousSibling.nextSibling=B.nextSibling}if(B.nextSibling){B.nextSibling.previousSibling=B.previousSibling}if(this.firstChild==B){this.setFirstChild(B.nextSibling)}if(this.lastChild==B){this.setLastChild(B.previousSibling)}B.setOwnerTree(null);B.parentNode=null;B.previousSibling=null;B.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,B);return B},insertBefore:function(C,B){if(!B){return this.appendChild(C)}if(C==B){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,C,B)===false){return false}var A=this.childNodes.indexOf(B);var E=C.parentNode;var D=A;if(E==this&&this.childNodes.indexOf(C)<A){D--}if(E){if(C.fireEvent("beforemove",C.getOwnerTree(),C,E,this,A,B)===false){return false}E.removeChild(C)}if(D==0){this.setFirstChild(C)}this.childNodes.splice(D,0,C);C.parentNode=this;var F=this.childNodes[D-1];if(F){C.previousSibling=F;F.nextSibling=C}else{C.previousSibling=null}C.nextSibling=B;B.previousSibling=C;C.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,C,B);if(E){C.fireEvent("move",this.ownerTree,C,E,this,D,B)}return C},item:function(A){return this.childNodes[A]},replaceChild:function(B,A){this.insertBefore(B,A);this.removeChild(A);return A},indexOf:function(A){return this.childNodes.indexOf(A)},getOwnerTree:function(){if(!this.ownerTree){var A=this;while(A){if(A.ownerTree){this.ownerTree=A.ownerTree;break}A=A.parentNode}}return this.ownerTree},getDepth:function(){var B=0;var A=this;while(A.parentNode){++B;A=A.parentNode}return B},setOwnerTree:function(D){if(D!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=D;var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){C[B].setOwnerTree(D)}if(D){D.registerNode(this)}}},getPath:function(C){C=C||"id";var D=this.parentNode;var A=[this.attributes[C]];while(D){A.unshift(D.attributes[C]);D=D.parentNode}var B=this.getOwnerTree().pathSeparator;return B+A.join(B)},bubble:function(C,B,A){var D=this;while(D){if(C.call(B||D,A||D)===false){break}D=D.parentNode}},cascade:function(F,C,B){if(F.call(C||this,B||this)!==false){var E=this.childNodes;for(var D=0,A=E.length;D<A;D++){E[D].cascade(F,C,B)}}},eachChild:function(D,F,E){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){if(D.call(F||this,E||C[B])===false){break}}},findChild:function(E,D){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){if(C[B].attributes[E]==D){return C[B]}}return null},findChildBy:function(E,B){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){if(E.call(B||D[C],D[C])===true){return D[C]}}return null},sort:function(E,F){var D=this.childNodes;var B=D.length;if(B>0){var A=F?function(){E.apply(F,arguments)}:E;D.sort(A);for(var C=0;C<B;C++){var G=D[C];G.previousSibling=D[C-1];G.nextSibling=D[C+1];if(C==0){this.setFirstChild(G)}if(C==B-1){this.setLastChild(G)}}}},contains:function(A){return A.isAncestor(this)},isAncestor:function(A){var B=this.parentNode;while(B){if(B==A){return true}B=B.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.ComponentMgr=function(){var A=new Ext.util.MixedCollection();return{register:function(B){A.add(B)},unregister:function(B){A.remove(B)},get:function(B){return A.get(B)},onAvailable:function(D,C,B){A.on("add",function(E,F){if(F.id==D){C.call(B||F,F);A.un("add",C,B)}})}}}();Ext.Component=function(A){A=A||{};if(A.tagName||A.dom||typeof A=="string"){A={el:A,id:A.id||A}}this.initialConfig=A;Ext.apply(this,A);this.addEvents({disable:true,enable:true,beforeshow:true,show:true,beforehide:true,hide:true,beforerender:true,render:true,beforedestroy:true,destroy:true});if(!this.id){this.id="ext-comp-"+(++Ext.Component.AUTO_ID)}Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);this.initComponent();if(this.renderTo){this.render(this.renderTo);delete this.renderTo}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{hidden:false,disabled:false,rendered:false,disabledClass:"x-item-disabled",allowDomMove:true,hideMode:"display",ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initComponent:Ext.emptyFn,render:function(B,A){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!B&&this.el){this.el=Ext.get(this.el);B=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(B);this.rendered=true;if(A!==undefined){if(typeof A=="number"){A=this.container.dom.childNodes[A]}else{A=Ext.getDom(A)}}this.onRender(this.container,A||null);if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide()}if(this.disabled){this.disable()}}return this},onRender:function(B,A){if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){B.dom.insertBefore(this.el.dom,A)}}},getAutoCreate:function(){var A=typeof this.autoCreate=="object"?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!A.id){A.id=this.id}return A},afterRender:Ext.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.purgeListeners();this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();if(this.actionMode=="container"){this.container.remove()}}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this)}},beforeDestroy:function(){},onDestroy:function(){},getEl:function(){return this.el},getId:function(){return this.id},focus:function(A){if(this.rendered){this.el.focus();if(A===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(){if(this.rendered){this.onDisable()}this.disabled=true;this.fireEvent("disable",this);return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(A){this[A?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){var A=this.getActionEl();if(this.hideMode=="visibility"){A.dom.style.visibility="visible"}else{if(this.hideMode=="offsets"){A.removeClass("x-hidden")}else{A.dom.style.display=""}}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide()}this.fireEvent("hide",this)}return this},onHide:function(){var A=this.getActionEl();if(this.hideMode=="visibility"){A.dom.style.visibility="hidden"}else{if(this.hideMode=="offsets"){A.addClass("x-hidden")}else{A.dom.style.display="none"}}},setVisible:function(A){if(A){this.show()}else{this.hide()}return this},isVisible:function(){return this.getActionEl().isVisible()},cloneConfig:function(B){B=B||{};var C=B.id||Ext.id();var A=Ext.applyIf(B,this.initialConfig);A.id=C;return new this.constructor(A)}});(function(){Ext.Layer=function(G,E){G=G||{};var D=Ext.DomHelper;var F=G.parentEl,C=F?Ext.getDom(F):document.body;if(E){this.dom=Ext.getDom(E)}if(!this.dom){var H=G.dh||{tag:"div",cls:"x-layer"};this.dom=D.append(C,H)}if(G.cls){this.addClass(G.cls)}this.constrain=G.constrain!==false;this.visibilityMode=Ext.Element.VISIBILITY;if(G.id){this.id=this.dom.id=G.id}else{this.id=Ext.id(this.dom)}this.zindex=G.zindex||this.getZIndex();this.position("absolute",this.zindex);if(G.shadow){this.shadowOffset=G.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:G.shadow})}else{this.shadowOffset=0}this.useShim=G.shim!==false&&Ext.useShims;this.useDisplay=G.useDisplay;this.hide()};var B=Ext.Element.prototype;var A=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt(this.getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var C=A.shift();if(!C){C=this.createShim();C.enableDisplayMode("block");C.dom.style.display="none";C.dom.style.visibility="visible"}var D=this.dom.parentNode;if(C.dom.parentNode!=D){D.insertBefore(C.dom,this.dom)}C.setStyle("z-index",this.getZIndex()-2);this.shim=C;return C},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);A.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(C){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(C){this.sync(true)}}},sync:function(F){var I=this.shadow;if(!this.updating&&this.isVisible()&&(I||this.useShim)){var E=this.getShim();var H=this.getWidth(),D=this.getHeight();var C=this.getLeft(true),J=this.getTop(true);if(I&&!this.shadowDisabled){if(F&&!I.isVisible()){I.show(this)}else{I.realign(C,J,H,D)}if(E){if(F){E.show()}var G=I.adjusts,K=E.dom.style;K.left=(Math.min(C,C+G.l))+"px";K.top=(Math.min(J,J+G.t))+"px";K.width=(H+G.w)+"px";K.height=(D+G.h)+"px"}}else{if(E){if(F){E.show()}E.setSize(H,D);E.setLeftTop(C,J)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();var C=this.dom.parentNode;if(C){C.removeChild(this.dom)}Ext.Element.uncache(this.id)},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(C){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var G=Ext.lib.Dom.getViewWidth(),D=Ext.lib.Dom.getViewHeight();var L=Ext.get(document).getScroll();var K=this.getXY();var H=K[0],F=K[1];var I=this.dom.offsetWidth+this.shadowOffset,E=this.dom.offsetHeight+this.shadowOffset;var C=false;if((H+I)>G+L.left){H=G-I-this.shadowOffset;C=true}if((F+E)>D+L.top){F=D-E-this.shadowOffset;C=true}if(H<L.left){H=L.left;C=true}if(F<L.top){F=L.top;C=true}if(C){if(this.avoidY){var J=this.avoidY;if(F<=J&&(F+E)>=J){F=J-E-5}}K=[H,F];this.storeXY(K);B.setXY.call(this,K);this.sync()}}},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){B.setXY.call(this,this.lastXY)}else{if(this.lastLT){B.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(E,D,G,H,F){if(E){this.showAction()}if(D&&E){var C=function(){this.sync(true);if(H){H()}}.createDelegate(this);B.setVisible.call(this,true,true,G,C,F)}else{if(!E){this.hideUnders(true)}var C=H;if(D){C=function(){this.hideAction();if(H){H()}}.createDelegate(this)}B.setVisible.call(this,E,D,G,C,F);if(E){this.sync(true)}else{if(!D){this.hideAction()}}}},storeXY:function(C){delete this.lastLT;this.lastXY=C},storeLeftTop:function(C,D){delete this.lastXY;this.lastLT=[C,D]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(C){this.storeLeftTop(C,this.getTop(true));B.setLeft.apply(this,arguments);this.sync()},setTop:function(C){this.storeLeftTop(this.getLeft(true),C);B.setTop.apply(this,arguments);this.sync()},setLeftTop:function(C,D){this.storeLeftTop(C,D);B.setLeftTop.apply(this,arguments);this.sync()},setXY:function(F,D,G,H,E){this.fixDisplay();this.beforeAction();this.storeXY(F);var C=this.createCB(H);B.setXY.call(this,F,D,G,C,E);if(!D){C()}},createCB:function(D){var C=this;return function(){C.constrainXY();C.sync(true);if(D){D()}}},setX:function(C,D,F,G,E){this.setXY([C,this.getY()],D,F,G,E)},setY:function(G,C,E,F,D){this.setXY([this.getX(),G],C,E,F,D)},setSize:function(E,F,D,H,I,G){this.beforeAction();var C=this.createCB(I);B.setSize.call(this,E,F,D,H,C,G);if(!D){C()}},setWidth:function(E,D,G,H,F){this.beforeAction();var C=this.createCB(H);B.setWidth.call(this,E,D,G,C,F);if(!D){C()}},setHeight:function(E,D,G,H,F){this.beforeAction();var C=this.createCB(H);B.setHeight.call(this,E,D,G,C,F);if(!D){C()}},setBounds:function(J,H,K,D,I,F,G,E){this.beforeAction();var C=this.createCB(G);if(!I){this.storeXY([J,H]);B.setXY.call(this,[J,H]);B.setSize.call(this,K,D,I,F,C,E);C()}else{B.setBounds.call(this,J,H,K,D,I,F,C,E)}return this},setZIndex:function(C){this.zindex=C;this.setStyle("z-index",C+2);if(this.shadow){this.shadow.setZIndex(C+1)}if(this.shim){this.shim.setStyle("z-index",C)}}})})();Ext.Shadow=function(C){Ext.apply(this,C);if(typeof this.mode!="string"){this.mode=this.defaultMode}var D=this.offset,A={h:0};var B=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":A.w=0;A.l=A.t=D;A.t-=1;if(Ext.isIE){A.l-=this.offset+B;A.t-=this.offset+B;A.w-=B;A.h-=B;A.t+=1}break;case"sides":A.w=(D*2);A.l=-D;A.t=D-1;if(Ext.isIE){A.l-=(this.offset-B);A.t-=this.offset+B;A.l+=1;A.w-=(this.offset-B)*2;A.w-=B+1;A.h-=1}break;case"frame":A.w=A.h=(D*2);A.l=A.t=-D;A.t+=1;A.h-=2;if(Ext.isIE){A.l-=(this.offset-B);A.t-=(this.offset-B);A.l+=1;A.w-=(this.offset+B+1);A.h-=(this.offset+B);A.h+=1}break}this.adjusts=A};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(A){A=Ext.get(A);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=A.dom){this.el.insertBefore(A)}}this.el.setStyle("z-index",this.zIndex||parseInt(A.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(A.getLeft(true),A.getTop(true),A.getWidth(),A.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(A,M,L,D){if(!this.el){return }var I=this.adjusts,G=this.el.dom,N=G.style;var F=0;N.left=(A+I.l)+"px";N.top=(M+I.t)+"px";var K=(L+I.w),C=(D+I.h),E=K+"px",J=C+"px";if(N.width!=E||N.height!=J){N.width=E;N.height=J;if(!Ext.isIE){var H=G.childNodes;var B=Math.max(0,(K-12))+"px";H[0].childNodes[1].style.width=B;H[1].childNodes[1].style.width=B;H[2].childNodes[1].style.width=B;H[1].style.height=Math.max(0,(C-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(A){this.zIndex=A;if(this.el){this.el.setStyle("z-index",A)}}};Ext.Shadow.Pool=function(){var B=[];var A=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var C=B.shift();if(!C){C=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,A));C.autoBoxAdjust=false}return C},push:function(C){B.push(C)}}}();Ext.BoxComponent=function(A){Ext.BoxComponent.superclass.constructor.call(this,A);this.addEvents({resize:true,move:true})};Ext.extend(Ext.BoxComponent,Ext.Component,{boxReady:false,deferHeight:false,setSize:function(B,D){if(typeof B=="object"){D=B.height;B=B.width}if(!this.boxReady){this.width=B;this.height=D;return this}if(this.lastSize&&this.lastSize.width==B&&this.lastSize.height==D){return this}this.lastSize={width:B,height:D};var C=this.adjustSize(B,D);var F=C.width,A=C.height;if(F!==undefined||A!==undefined){var E=this.getResizeEl();if(!this.deferHeight&&F!==undefined&&A!==undefined){E.setSize(F,A)}else{if(!this.deferHeight&&A!==undefined){E.setHeight(A)}else{if(F!==undefined){E.setWidth(F)}}}this.onResize(F,A,B,D);this.fireEvent("resize",this,F,A,B,D)}return this},getSize:function(){return this.el.getSize()},getPosition:function(A){if(A===true){return[this.el.getLeft(true),this.el.getTop(true)]}return this.xy||this.el.getXY()},getBox:function(A){var B=this.el.getSize();if(A){B.x=this.el.getLeft(true);B.y=this.el.getTop(true)}else{var C=this.xy||this.el.getXY();B.x=C[0];B.y=C[1]}return B},updateBox:function(A){this.setSize(A.width,A.height);this.setPagePosition(A.x,A.y);return this},getResizeEl:function(){return this.resizeEl||this.el},getPositionEl:function(){return this.positionEl||this.el},setPosition:function(A,F){this.x=A;this.y=F;if(!this.boxReady){return this}var E=this.adjustPosition(A,F);var D=E.x,C=E.y;var B=this.getPositionEl();if(D!==undefined||C!==undefined){if(D!==undefined&&C!==undefined){B.setLeftTop(D,C)}else{if(D!==undefined){B.setLeft(D)}else{if(C!==undefined){B.setTop(C)}}}this.onPosition(D,C);this.fireEvent("move",this,D,C)}return this},setPagePosition:function(A,C){this.pageX=A;this.pageY=C;if(!this.boxReady){return }if(A===undefined||C===undefined){return }var B=this.el.translatePoints(A,C);this.setPosition(B.left,B.top);return this},onRender:function(B,A){Ext.BoxComponent.superclass.onRender.call(this,B,A);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}},syncSize:function(){this.setSize(this.el.getWidth(),this.el.getHeight());return this},onResize:function(B,A,D,C){},onPosition:function(A,B){},adjustSize:function(A,B){if(this.autoWidth){A="auto"}if(this.autoHeight){B="auto"}return{width:A,height:B}},adjustPosition:function(A,B){return{x:A,y:B}}});Ext.SplitBar=function(E,D,C,B,A){this.el=Ext.get(E,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(D,true);this.orientation=C||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!A){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(A).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=B||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=B||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents({"resize":true,"moved":true,"beforeresize":true,"beforeapply":true});Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(B,F){this.fireEvent("beforeresize",this);if(!this.overlay){var E=Ext.DomHelper.insertFirst(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);E.unselectable();E.enableDisplayMode("block");Ext.SplitBar.prototype.overlay=E}this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var A=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var D=A-this.activeMinSize;var C=Math.max(this.activeMaxSize-A,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?D:C,this.placement==Ext.SplitBar.LEFT?C:D);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?D:C,this.placement==Ext.SplitBar.TOP?C:D)}this.dragSpecs.startSize=A;this.dragSpecs.startPoint=[B,F];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,B,F)},onEndProxyDrag:function(C){Ext.get(this.proxy).setDisplayed(false);var B=Ext.lib.Event.getXY(C);if(this.overlay){this.overlay.hide()}var A;if(this.orientation==Ext.SplitBar.HORIZONTAL){A=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?B[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-B[0])}else{A=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?B[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-B[1])}A=Math.min(Math.max(A,this.activeMinSize),this.activeMaxSize);if(A!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,A)!==false){this.adapter.setElementSize(this,A);this.fireEvent("moved",this,A);this.fireEvent("resize",this,A)}}},getAdapter:function(){return this.adapter},setAdapter:function(A){this.adapter=A;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(A){this.minSize=A},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(A){this.maxSize=A},setCurrentSize:function(B){var A=this.animate;this.animate=false;this.adapter.setElementSize(this,B);this.animate=A},destroy:function(A){if(this.shim){this.shim.remove()}this.dd.unreg();this.proxy.parentNode.removeChild(this.proxy);if(A){this.el.remove()}}});Ext.SplitBar.createProxy=function(B){var C=new Ext.Element(document.createElement("div"));C.unselectable();var A="x-splitbar-proxy";C.addClass(A+" "+(B==Ext.SplitBar.HORIZONTAL?A+"-h":A+"-v"));document.body.appendChild(C.dom);return C.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(A){},getElementSize:function(A){if(A.orientation==Ext.SplitBar.HORIZONTAL){return A.resizingEl.getWidth()}else{return A.resizingEl.getHeight()}},setElementSize:function(C,B,A){if(C.orientation==Ext.SplitBar.HORIZONTAL){if(!C.animate){C.resizingEl.setWidth(B);if(A){A(C,B)}}else{C.resizingEl.setWidth(B,true,0.1,A,"easeOut")}}else{if(!C.animate){C.resizingEl.setHeight(B);if(A){A(C,B)}}else{C.resizingEl.setHeight(B,true,0.1,A,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(A){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(A)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(A){this.basic.init(A)},getElementSize:function(A){return this.basic.getElementSize(A)},setElementSize:function(B,A,C){this.basic.setElementSize(B,A,this.moveSplitter.createDelegate(this,[B]))},moveSplitter:function(A){var B=Ext.SplitBar;switch(A.placement){case B.LEFT:A.el.setX(A.resizingEl.getRight());break;case B.RIGHT:A.el.setStyle("right",(this.container.getWidth()-A.resizingEl.getLeft())+"px");break;case B.TOP:A.el.setY(A.resizingEl.getBottom());break;case B.BOTTOM:A.el.setY(A.resizingEl.getTop()-A.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.View=function(C,B,A){this.el=Ext.get(C);if(typeof B=="string"){B=new Ext.Template(B)}B.compile();this.tpl=B;Ext.apply(this,A);this.addEvents({"beforeclick":true,"click":true,"dblclick":true,"contextmenu":true,"selectionchange":true,"beforeselect":true});this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this});this.selections=[];this.nodes=[];this.cmp=new Ext.CompositeElementLite([]);if(this.store){this.setStore(this.store,true)}Ext.View.superclass.constructor.call(this)};Ext.extend(Ext.View,Ext.util.Observable,{selectedClass:"x-view-selected",emptyText:"",getEl:function(){return this.el},refresh:function(){var F=this.tpl;this.clearSelections();this.el.update("");var E=[];var C=this.store.getRange();if(C.length<1){this.el.update(this.emptyText);return }for(var D=0,B=C.length;D<B;D++){var A=this.prepareData(C[D].data,D,C[D]);E[E.length]=F.apply(A)}this.el.update(E.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0)},prepareData:function(A){return A},onUpdate:function(C,B){this.clearSelections();var A=this.store.indexOf(B);var D=this.nodes[A];this.tpl.insertBefore(D,this.prepareData(B.data));D.parentNode.removeChild(D);this.updateIndexes(A,A)},onAdd:function(C,G,E){this.clearSelections();if(this.nodes.length==0){this.refresh();return }var F=this.nodes[E];for(var B=0,A=G.length;B<A;B++){var D=this.prepareData(G[B].data);if(F){this.tpl.insertBefore(F,D)}else{this.tpl.append(this.el,D)}}this.updateIndexes(E)},onRemove:function(C,B,A){this.clearSelections();this.el.dom.removeChild(this.nodes[A]);this.updateIndexes(A)},refreshNode:function(A){this.onUpdate(this.store,this.store.getAt(A))},updateIndexes:function(D,B){var C=this.nodes;D=D||0;B=B||C.length-1;for(var A=D;A<=B;A++){C[A].nodeIndex=A}},setStore:function(B,A){if(!A&&this.store){this.store.un("datachanged",this.refresh);this.store.un("add",this.onAdd);this.store.un("remove",this.onRemove);this.store.un("update",this.onUpdate);this.store.un("clear",this.refresh)}if(B){B.on("datachanged",this.refresh,this);B.on("add",this.onAdd,this);B.on("remove",this.onRemove,this);B.on("update",this.onUpdate,this);B.on("clear",this.refresh,this)}this.store=B;if(B){this.refresh()}},findItemFromChild:function(A){var B=this.el.dom;if(!A||A.parentNode==B){return A}var C=A.parentNode;while(C&&C!=B){if(C.parentNode==B){return C}C=C.parentNode}return null},onClick:function(C){var B=this.findItemFromChild(C.getTarget());if(B){var A=this.indexOf(B);if(this.onItemClick(B,A,C)!==false){this.fireEvent("click",this,A,B,C)}}else{this.clearSelections()}},onContextMenu:function(B){var A=this.findItemFromChild(B.getTarget());if(A){this.fireEvent("contextmenu",this,this.indexOf(A),A,B)}},onDblClick:function(B){var A=this.findItemFromChild(B.getTarget());if(A){this.fireEvent("dblclick",this,this.indexOf(A),A,B)}},onItemClick:function(B,A,C){if(this.fireEvent("beforeclick",this,A,B,C)===false){return false}if(this.multiSelect||this.singleSelect){if(this.multiSelect&&C.shiftKey&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),A),false)}else{this.select(B,this.multiSelect&&C.ctrlKey);this.lastSelection=B}C.preventDefault()}return true},getSelectionCount:function(){return this.selections.length},getSelectedNodes:function(){return this.selections},getSelectedIndexes:function(){var C=[],D=this.selections;for(var B=0,A=D.length;B<A;B++){C.push(D[B].nodeIndex)}return C},clearSelections:function(A){if(this.nodes&&(this.multiSelect||this.singleSelect)&&this.selections.length>0){this.cmp.elements=this.selections;this.cmp.removeClass(this.selectedClass);this.selections=[];if(!A){this.fireEvent("selectionchange",this,this.selections)}}},isSelected:function(A){var B=this.selections;if(B.length<1){return false}A=this.getNode(A);return B.indexOf(A)!==-1},select:function(F,E,D){if(F instanceof Array){if(!E){this.clearSelections(true)}for(var B=0,A=F.length;B<A;B++){this.select(F[B],true,true)}}else{var C=this.getNode(F);if(C&&!this.isSelected(C)){if(!E){this.clearSelections(true)}if(this.fireEvent("beforeselect",this,C,this.selections)!==false){Ext.fly(C).addClass(this.selectedClass);this.selections.push(C);if(!D){this.fireEvent("selectionchange",this,this.selections)}}}}},getNode:function(A){if(typeof A=="string"){return document.getElementById(A)}else{if(typeof A=="number"){return this.nodes[A]}}return A},getNodes:function(E,A){var D=this.nodes;E=E||0;A=typeof A=="undefined"?D.length-1:A;var C=[];if(E<=A){for(var B=E;B<=A;B++){C.push(D[B])}}else{for(var B=E;B>=A;B--){C.push(D[B])}}return C},indexOf:function(D){D=this.getNode(D);if(typeof D.nodeIndex=="number"){return D.nodeIndex}var C=this.nodes;for(var B=0,A=C.length;B<A;B++){if(C[B]==D){return B}}return -1}});Ext.JsonView=function(D,C,B){Ext.JsonView.superclass.constructor.call(this,D,C,B);var A=this.el.getUpdateManager();A.setRenderer(this);A.on("update",this.onLoad,this);A.on("failure",this.onLoadException,this);this.addEvents({"beforerender":true,"load":true,"loadexception":true})};Ext.extend(Ext.JsonView,Ext.View,{jsonRoot:"",refresh:function(){this.clearSelections();this.el.update("");var D=[];var E=this.jsonData;if(E&&E.length>0){for(var C=0,B=E.length;C<B;C++){var A=this.prepareData(E[C],C,E);D[D.length]=this.tpl.apply(A)}}else{D.push(this.emptyText)}this.el.update(D.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0)},load:function(){var A=this.el.getUpdateManager();A.update.apply(A,arguments)},render:function(el,_c){this.clearSelections();this.el.update("");var o;try{o=Ext.util.JSON.decode(_c.responseText);if(this.jsonRoot){o=eval("o."+this.jsonRoot)}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh()},getCount:function(){return this.jsonData?this.jsonData.length:0},getNodeData:function(B){if(B instanceof Array){var D=[];for(var C=0,A=B.length;C<A;C++){D.push(this.getNodeData(B[C]))}return D}return this.jsonData[this.indexOf(B)]||null},beforeRender:function(){this.snapshot=this.jsonData;if(this.sortInfo){this.sort.apply(this,this.sortInfo)}this.fireEvent("beforerender",this,this.jsonData)},onLoad:function(A,B){this.fireEvent("load",this,this.jsonData,B)},onLoadException:function(A,B){this.fireEvent("loadexception",this,B)},filter:function(F,C){if(this.jsonData){var B=[];var E=this.snapshot;if(typeof C=="string"){var G=C.length;if(G==0){this.clearFilter();return }C=C.toLowerCase();for(var D=0,A=E.length;D<A;D++){var H=E[D];if(H[F].substr(0,G).toLowerCase()==C){B.push(H)}}}else{if(C.exec){for(var D=0,A=E.length;D<A;D++){var H=E[D];if(C.test(H[F])){B.push(H)}}}else{return }}this.jsonData=B;this.refresh()}},filterBy:function(F,B){if(this.jsonData){var C=[];var E=this.snapshot;for(var D=0,A=E.length;D<A;D++){var G=E[D];if(F.call(B||this,G)){C.push(G)}}this.jsonData=C;this.refresh()}},clearFilter:function(){if(this.snapshot&&this.jsonData!=this.snapshot){this.jsonData=this.snapshot;this.refresh()}},sort:function(E,A,C){this.sortInfo=Array.prototype.slice.call(arguments,0);if(this.jsonData){var F=E;var B=A&&A.toLowerCase()=="desc";var D=function(H,G){var J=C?C(H[F]):H[F];var I=C?C(G[F]):G[F];if(J<I){return B?+1:-1}else{if(J>I){return B?-1:+1}else{return 0}}};this.jsonData.sort(D);this.refresh();if(this.jsonData!=this.snapshot){this.snapshot.sort(D)}}}});Ext.ColorPalette=function(A){Ext.ColorPalette.superclass.constructor.call(this,A);this.addEvents({select:true});if(this.handler){this.on("select",this.handler,this.scope,true)}};Ext.extend(Ext.ColorPalette,Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(F,E){var C=new Ext.MasterTemplate('<tpl><a href="#" class="color-{0}" hidefocus="on"><em><span style="background:#{0}" unselectable="on">&#160;</span></em></a></tpl>');var G=this.colors;for(var B=0,A=G.length;B<A;B++){C.add([G[B]])}var D=document.createElement("div");D.className=this.itemCls;C.overwrite(D);F.dom.insertBefore(D,E);this.el=Ext.get(D);this.el.on(this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.el.on("click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var A=this.value;this.value=null;this.select(A)}},handleClick:function(B,A){B.preventDefault();if(!this.disabled){var C=A.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(C.toUpperCase())}},select:function(A){A=A.replace("#","");if(A!=this.value||this.allowReselect){var B=this.el;if(this.value){B.child("a.color-"+this.value).removeClass("x-color-palette-sel")}B.child("a.color-"+A).addClass("x-color-palette-sel");this.value=A;this.fireEvent("select",this,A)}}});Ext.DatePicker=function(D){Ext.DatePicker.superclass.constructor.call(this,D);this.value=D&&D.value?D.value.clearTime():new Date().clearTime();this.addEvents({select:true});if(this.handler){this.on("select",this.handler,this.scope||this)}if(!this.disabledDatesRE&&this.disabledDates){var A=this.disabledDates;var C="(?:";for(var B=0;B<A.length;B++){C+=A[B];if(B!=A.length-1){C+="|"}}this.disabledDatesRE=new RegExp(C+")")}};Ext.extend(Ext.DatePicker,Ext.Component,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minDate:null,maxDate:null,minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDays:null,disabledDaysText:"",disabledDatesRE:null,disabledDatesText:"",constrainToViewport:true,monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,setValue:function(B){var A=this.value;this.value=B.clearTime(true);if(this.el){this.update(this.value)}},getValue:function(){return this.value},focus:function(){if(this.el){this.update(this.activeDate)}},onRender:function(H,G){var D=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'];var F=this.dayNames;for(var E=0;E<7;E++){var I=this.startDay+E;if(I>6){I=I-7}D.push("<th><span>",F[I].substr(0,1),"</span></th>")}D[D.length]="</tr></thead><tbody><tr>";for(var E=0;E<42;E++){if(E%7==0&&E!=0){D[D.length]="</tr><tr>"}D[D.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}D[D.length]='</tr></tbody></table></td></tr><tr><td colspan="3" class="x-date-bottom" align="center"></td></tr></table><div class="x-date-mp"></div>';var A=document.createElement("div");A.className="x-date-picker";A.innerHTML=D.join("");H.dom.insertBefore(A,G);this.el=Ext.get(A);this.eventEl=Ext.get(A.firstChild);new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.eventEl.on("mousewheel",this.handleMouseWheel,this);this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");var J=new Ext.KeyNav(this.eventEl,{"left":function(K){K.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},"right":function(K){K.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},"up":function(K){K.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7))},"down":function(K){K.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7))},"pageUp":function(K){this.showNextMonth()},"pageDown":function(K){this.showPrevMonth()},"enter":function(K){K.stopPropagation();return true},scope:this});this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button(this.el.child("td.x-date-middle",true),{text:"&#160;",tooltip:this.monthYearText});this.mbtn.on("click",this.showMonthPicker,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");var C=(new Date()).dateFormat(this.format);var B=new Ext.Button(this.el.child("td.x-date-bottom",true),{text:String.format(this.todayText,C),tooltip:String.format(this.todayTip,C),handler:this.selectToday,scope:this});if(Ext.isIE){this.el.repaint()}this.update(this.value)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var A=['<table border="0" cellspacing="0">'];for(var B=0;B<6;B++){A.push('<tr><td class="x-date-mp-month"><a href="#">',this.monthNames[B].substr(0,3),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',this.monthNames[B+6].substr(0,3),"</a></td>",B==0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}A.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(A.join(""));this.monthPicker.on("click",this.onMonthClick,this);this.monthPicker.on("dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(C,D,E){E+=1;if((E%2)==0){C.dom.xmonth=5+Math.round(E*0.5)}else{C.dom.xmonth=Math.round((E-1)*0.5)}})}},showMonthPicker:function(){this.createMonthPicker();var A=this.el.getSize();this.monthPicker.setSize(A);this.monthPicker.child("table").setSize(A);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})},updateMPYear:function(E){this.mpyear=E;var C=this.mpYears.elements;for(var B=1;B<=10;B++){var D=C[B-1],A;if((B%2)==0){A=E+Math.round(B*0.5);D.firstChild.innerHTML=A;D.xyear=A}else{A=E-(5-Math.round(B*0.5));D.firstChild.innerHTML=A;D.xyear=A}this.mpYears.item(B-1)[A==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(A){this.mpMonths.each(function(B,C,D){B[B.dom.xmonth==A?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(A){},onMonthClick:function(D,B){D.stopEvent();var C=new Ext.Element(B),A;if(C.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(C.is("button.x-date-mp-ok")){this.update(new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if(A=C.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");A.addClass("x-date-mp-sel");this.mpSelMonth=A.dom.xmonth}else{if(A=C.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");A.addClass("x-date-mp-sel");this.mpSelYear=A.dom.xyear}else{if(C.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(C.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(D,B){D.stopEvent();var C=new Ext.Element(B),A;if(A=C.up("td.x-date-mp-month",2)){this.update(new Date(this.mpSelYear,A.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if(A=C.up("td.x-date-mp-year",2)){this.update(new Date(A.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(A){if(this.monthPicker){if(A===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(A){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(A){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(A){var B=A.getWheelDelta();if(B>0){this.showPrevMonth();A.stopEvent()}else{if(B<0){this.showNextMonth();A.stopEvent()}}},handleDateClick:function(B,A){B.stopEvent();if(A.dateValue&&!Ext.fly(A.parentNode).hasClass("x-date-disabled")){this.setValue(new Date(A.dateValue));this.fireEvent("select",this,this.value)}},selectToday:function(){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)},update:function(Q){var B=this.activeDate;this.activeDate=Q;if(B&&this.el){var N=Q.getTime();if(B.getMonth()==Q.getMonth()&&B.getFullYear()==Q.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(a){if(a.dom.firstChild.dateValue==N){a.addClass("x-date-selected");setTimeout(function(){try{a.dom.firstChild.focus()}catch(c){}},50);return false}});return }}var Y=Q.getDaysInMonth();var W=Q.getFirstDateOfMonth();var V=W.getDay()-this.startDay;if(V<=this.startDay){V+=7}var X=Q.add("mo",-1);var R=X.getDaysInMonth()-V;var J=this.cells.elements;var I=this.textNodes;Y+=V;var T=86400000;var Z=(new Date(X.getFullYear(),X.getMonth(),R)).clearTime();var F=new Date().clearTime().getTime();var P=Q.clearTime().getTime();var O=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var U=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var C=this.disabledDatesRE;var A=this.disabledDatesText;var H=this.disabledDays?this.disabledDays.join(""):false;var G=this.disabledDaysText;var E=this.format;var D=function(e,d){d.title="";var a=Z.getTime();d.firstChild.dateValue=a;if(a==F){d.className+=" x-date-today";d.title=e.todayText}if(a==P){d.className+=" x-date-selected";setTimeout(function(){try{d.firstChild.focus()}catch(g){}},50)}if(a<O){d.className=" x-date-disabled";d.title=e.minText;return }if(a>U){d.className=" x-date-disabled";d.title=e.maxText;return }if(H){if(H.indexOf(Z.getDay())!=-1){d.title=G;d.className=" x-date-disabled"}}if(C&&E){var c=Z.dateFormat(E);if(C.test(c)){d.title=A.replace("%0",c);d.className=" x-date-disabled"}}};var S=0;for(;S<V;S++){I[S].innerHTML=(++R);Z.setDate(Z.getDate()+1);J[S].className="x-date-prevday";D(this,J[S])}for(;S<Y;S++){intDay=S-V+1;I[S].innerHTML=(intDay);Z.setDate(Z.getDate()+1);J[S].className="x-date-active";D(this,J[S])}var M=0;for(;S<42;S++){I[S].innerHTML=(++M);Z.setDate(Z.getDate()+1);J[S].className="x-date-nextday";D(this,J[S])}this.mbtn.setText(this.monthNames[Q.getMonth()]+" "+Q.getFullYear());if(!this.internalRender){var L=this.el.dom.firstChild;var K=L.offsetWidth;this.el.setWidth(K+this.el.getBorderWidth("lr"));Ext.fly(L).setWidth(K);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){L.rows[0].cells[1].style.width=(K-(L.rows[0].cells[0].offsetWidth+L.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[Q])}}}});Ext.TabPanel=function(B,A){this.el=Ext.get(B,true);if(A){if(typeof A=="boolean"){this.tabPosition=A?"bottom":"top"}else{Ext.apply(this,A)}}if(this.tabPosition=="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-bottom")}this.stripWrap=Ext.get(this.createStrip(this.el.dom),true);this.stripEl=Ext.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Ext.get(this.stripWrap.dom.firstChild.firstChild,true);if(Ext.isIE){Ext.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden")}if(this.tabPosition!="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-top")}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true});Ext.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;Ext.TabPanel.superclass.constructor.call(this)};Ext.extend(Ext.TabPanel,Ext.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,addTab:function(E,D,C,B){var A=new Ext.TabPanelItem(this,E,D,B);this.addTabItem(A);if(C){A.setContent(C)}return A},getTab:function(A){return this.items[A]},hideTab:function(B){var A=this.items[B];if(!A.isHidden()){A.setHidden(true);this.hiddenCount++;this.autoSizeTabs()}},unhideTab:function(B){var A=this.items[B];if(A.isHidden()){A.setHidden(false);this.hiddenCount--;this.autoSizeTabs()}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);if(this.resizeTabs){A.setWidth(this.currentTabWidth||this.preferredTabWidth);this.autoSizeTabs()}else{A.autoSize()}},removeTab:function(E){var D=this.items;var A=D[E];if(!A){return }var C=D.indexOf(A);if(this.active==A&&D.length>1){var B=this.getNextAvailable(C);if(B){B.activate()}}this.stripEl.dom.removeChild(A.pnode.dom);if(A.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(A.bodyEl.dom)}D.splice(C,1);delete this.items[A.id];A.fireEvent("close",A);A.purgeListeners();this.autoSizeTabs()},getNextAvailable:function(D){var C=this.items;var B=D;while(B<C.length){var A=C[++B];if(A&&!A.isHidden()){return A}}B=D;while(B>=0){var A=C[--B];if(A&&!A.isHidden()){return A}}return null},disableTab:function(B){var A=this.items[B];if(A&&this.active!=A){A.disable()}},enableTab:function(B){var A=this.items[B];A.enable()},activate:function(C){var A=this.items[C];if(!A){return null}if(A==this.active||A.disabled){return A}var B={};this.fireEvent("beforetabchange",this,B,A);if(B.cancel!==true&&!A.disabled){if(this.active){this.active.hide()}this.active=this.items[C];this.active.show();this.fireEvent("tabchange",this,this.active)}return A},getActiveTab:function(){return this.active},syncHeight:function(C){var B=(C||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var D=this.bodyEl.getMargins();var A=B-(this.stripWrap.getHeight()||0)-(D.top+D.bottom);this.bodyEl.setHeight(A);return A},onResize:function(){if(this.monitorResize){this.autoSizeTabs()}},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.autoSizeTabs()},autoSizeTabs:function(){var F=this.items.length;var E=F-this.hiddenCount;if(!this.resizeTabs||F<1||E<1||this.updating){return }var B=Math.max(this.el.getWidth()-this.cpad,10);var D=Math.floor(B/E);var A=this.stripBody;if(A.getWidth()>B){var C=this.items;this.setTabWidth(Math.max(D,this.minTabWidth)-2);if(D<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(D,this.preferredTabWidth)-2)}}},getCount:function(){return this.items.length},setTabWidth:function(C){this.currentTabWidth=C;for(var B=0,A=this.items.length;B<A;B++){if(!this.items[B].isHidden()){this.items[B].setWidth(C)}}},destroy:function(C){Ext.EventManager.removeResizeListener(this.onResize,this);for(var B=0,A=this.items.length;B<A;B++){this.items[B].purgeListeners()}if(C===true){this.el.update("");this.el.remove()}}});Ext.TabPanelItem=function(C,F,B,A){this.tabPanel=C;this.id=F;this.disabled=false;this.text=B;this.loaded=false;this.closable=A;this.bodyEl=Ext.get(C.createItemBody(C.bodyEl.dom,F));this.bodyEl.setVisibilityMode(Ext.Element.VISIBILITY);this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");this.hideAction();var D=C.createStripElements(C.stripEl.dom,B,A);this.el=Ext.get(D.el,true);this.inner=Ext.get(D.inner,true);this.textEl=Ext.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Ext.get(D.el.parentNode,true);this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(A){var E=Ext.get(D.close,true);E.dom.title=this.closeText;E.addClassOnOver("close-over");E.on("click",this.closeClick,this)}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Ext.TabPanelItem.superclass.constructor.call(this)};Ext.extend(Ext.TabPanelItem,Ext.util.Observable,{purgeListeners:function(){Ext.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners()},show:function(){this.pnode.addClass("on");this.showAction();if(Ext.isOpera){this.tabPanel.stripWrap.repaint()}this.fireEvent("activate",this.tabPanel,this)},isActive:function(){return this.tabPanel.getActiveTab()==this},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this)},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px")},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show()},setTooltip:function(A){if(Ext.QuickTips&&Ext.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute("title")}else{this.textEl.dom.title=A}},onTabClick:function(A){A.preventDefault();this.tabPanel.activate(this.id)},onTabMouseDown:function(A){A.preventDefault();this.tabPanel.activate(this.id)},getWidth:function(){return this.inner.getWidth()},setWidth:function(B){var A=B-this.pnode.getPadding("lr");this.inner.setWidth(A);this.textEl.setWidth(A-this.inner.getPadding("lr"));this.pnode.setWidth(B)},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"")},isHidden:function(){return this.hidden},getText:function(){return this.text},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"))},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize()}},activate:function(){this.tabPanel.activate(this.id)},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled")}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled")},setContent:function(B,A){this.bodyEl.update(B,A)},getUpdateManager:function(){return this.bodyEl.getUpdateManager()},setUrl:function(A,C,B){if(this.refreshDelegate){this.un("activate",this.refreshDelegate)}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,C,B]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager()},_handleRefresh:function(C,D,B){if(!B||!this.loaded){var A=this.bodyEl.getUpdateManager();A.update(C,D,this._setLoaded.createDelegate(this))}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate()}},_setLoaded:function(){this.loaded=true},closeClick:function(A){var B={};A.stopEvent();this.fireEvent("beforeclose",this,B);if(B.cancel!==true){this.tabPanel.removeTab(this.id)}},closeText:"Close this tab"});Ext.TabPanel.prototype.createStrip=function(B){var A=document.createElement("div");A.className="x-tabs-wrap";B.appendChild(A);return A};Ext.TabPanel.prototype.createStripList=function(A){A.innerHTML='<div class="x-tabs-strip-wrap"><table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr></tr></tbody></table></div>';return A.firstChild.firstChild.firstChild.firstChild};Ext.TabPanel.prototype.createBody=function(B){var A=document.createElement("div");Ext.id(A,"tab-body");Ext.fly(A).addClass("x-tabs-body");B.appendChild(A);return A};Ext.TabPanel.prototype.createItemBody=function(C,B){var A=Ext.getDom(B);if(!A){A=document.createElement("div");A.id=B}Ext.fly(A).addClass("x-tabs-item-body");C.insertBefore(A,C.firstChild);return A};Ext.TabPanel.prototype.createStripElements=function(F,D,E){var G=document.createElement("td");F.appendChild(G);if(E){G.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Ext.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner"><span unselectable="on"'+(this.disableTooltips?"":' title="{text}"')+' class="x-tabs-text">{text}</span><div unselectable="on" class="close-icon">&#160;</div></em></span></a>')}var C=this.closeTpl.overwrite(G,{"text":D});var B=C.getElementsByTagName("div")[0];var A=C.getElementsByTagName("em")[0];return{"el":C,"close":B,"inner":A}}else{if(!this.tabTpl){this.tabTpl=new Ext.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner"><span unselectable="on"'+(this.disableTooltips?"":' title="{text}"')+' class="x-tabs-text">{text}</span></em></span></a>')}var C=this.tabTpl.overwrite(G,{"text":D});var A=C.getElementsByTagName("em")[0];return{"el":C,"inner":A}}};Ext.Button=function(B,A){Ext.apply(this,A);this.addEvents({"click":true,"toggle":true,"mouseover":true,"mouseout":true});if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}if(B){this.render(B)}Ext.Button.superclass.constructor.call(this)};Ext.extend(Ext.Button,Ext.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:"button",menuClassTarget:"tr",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",render:function(D){var C;if(this.hideParent){this.parentEl=Ext.get(D)}if(!this.dhconfig){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>','<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i>&#160;</i></td>',"</tr></tbody></table>")}this.template=Ext.Button.buttonTemplate}C=this.template.append(D,[this.text||"&#160;",this.type],true);var B=C.child("button:first");B.on("focus",this.onFocus,this);B.on("blur",this.onBlur,this);if(this.cls){C.addClass(this.cls)}if(this.icon){B.setStyle("background-image","url("+this.icon+")")}if(this.iconCls){B.addClass(this.iconCls);if(!this.cls){C.addClass(this.text?"x-btn-text-icon":"x-btn-icon")}}if(this.tabIndex!==undefined){B.dom.tabIndex=this.tabIndex}if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.tips(Ext.apply({target:B.id},this.tooltip))}else{B.dom[this.tooltipType]=this.tooltip}}}else{C=Ext.DomHelper.append(Ext.get(D).dom,this.dhconfig,true)}this.el=C;if(this.id){this.el.dom.id=this.el.id=this.id}if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this)}C.addClass("x-btn");if(Ext.isIE&&!Ext.isIE7){this.autoWidth.defer(1,this)}else{this.autoWidth()}if(this.handleMouseEvents){C.on("mouseover",this.onMouseOver,this);C.on("mouseout",this.onMouseOut,this);C.on("mousedown",this.onMouseDown,this)}C.on(this.clickEvent,this.onClick,this);if(this.hidden){this.hide()}if(this.disabled){this.disable()}Ext.ButtonToggleMgr.register(this);if(this.pressed){this.el.addClass("x-btn-pressed")}if(this.repeat){var A=new Ext.util.ClickRepeater(C,typeof this.repeat=="object"?this.repeat:{});A.on("click",this.onClick,this)}},getEl:function(){return this.el},destroy:function(){Ext.ButtonToggleMgr.unregister(this);this.el.removeAllListeners();this.purgeListeners();this.el.remove()},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var A=this.el.child("button");if(A&&A.getWidth()>20){A.clip();A.setWidth(Ext.util.TextMetrics.measure(A,this.text).width+A.getFrameWidth("lr"))}}if(this.minWidth){if(this.hidden){this.el.beginMeasure()}if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth)}if(this.hidden){this.el.endMeasure()}}}},setHandler:function(B,A){this.handler=B;this.scope=A},setText:function(A){this.text=A;if(this.el){this.el.child("td.x-btn-center button.x-btn-text").update(A)}this.autoWidth()},getText:function(){return this.text},show:function(){this.hidden=false;if(this.el){this[this.hideParent?"parentEl":"el"].setStyle("display","")}},hide:function(){this.hidden=true;if(this.el){this[this.hideParent?"parentEl":"el"].setStyle("display","none")}},setVisible:function(A){if(A){this.show()}else{this.hide()}},toggle:function(A){A=A===undefined?!this.pressed:A;if(A!=this.pressed){if(A){this.el.addClass("x-btn-pressed");this.pressed=true;this.fireEvent("toggle",this,true)}else{this.el.removeClass("x-btn-pressed");this.pressed=false;this.fireEvent("toggle",this,false)}if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,A)}}},focus:function(){this.el.child("button:first").focus()},disable:function(){if(this.el){this.el.addClass("x-btn-disabled")}this.disabled=true},enable:function(){if(this.el){this.el.removeClass("x-btn-disabled")}this.disabled=false},setDisabled:function(A){this[A!==true?"enable":"disable"]()},onClick:function(A){if(A){A.preventDefault()}if(A.button!=0){return }if(!this.disabled){if(this.enableToggle){this.toggle()}if(this.menu&&!this.menu.isVisible()){this.menu.show(this.el,this.menuAlign)}this.fireEvent("click",this,A);if(this.handler){this.el.removeClass("x-btn-over");this.handler.call(this.scope||this,this,A)}}},onMouseOver:function(A){if(!this.disabled){this.el.addClass("x-btn-over");this.fireEvent("mouseover",this,A)}},onMouseOut:function(A){if(!A.within(this.el,true)){this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,A)}},onFocus:function(A){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(A){this.el.removeClass("x-btn-focus")},onMouseDown:function(A){if(!this.disabled&&A.button==0){this.el.addClass("x-btn-click");Ext.get(document).on("mouseup",this.onMouseUp,this)}},onMouseUp:function(A){if(A.button==0){this.el.removeClass("x-btn-click");Ext.get(document).un("mouseup",this.onMouseUp,this)}},onMenuShow:function(A){this.el.addClass("x-btn-menu-active")},onMenuHide:function(A){this.el.removeClass("x-btn-menu-active")}});Ext.ButtonToggleMgr=function(){var A={};function B(F,D){if(D){var G=A[F.toggleGroup];for(var E=0,C=G.length;E<C;E++){if(G[E]!=F){G[E].toggle(false)}}}}return{register:function(C){if(!C.toggleGroup){return }var D=A[C.toggleGroup];if(!D){D=A[C.toggleGroup]=[]}D.push(C);C.on("toggle",B)},unregister:function(C){if(!C.toggleGroup){return }var D=A[C.toggleGroup];if(D){D.remove(C);C.un("toggle",B)}}}}();Ext.SplitButton=function(B,A){Ext.SplitButton.superclass.constructor.call(this,B,A);this.addEvents({"arrowclick":true})};Ext.extend(Ext.SplitButton,Ext.Button,{render:function(D){var C=new Ext.Template('<table cellspacing="0" class="x-btn-menu-wrap x-btn"><tr><td>','<table cellspacing="0" class="x-btn-wrap x-btn-menu-text-wrap"><tbody>','<tr><td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><button class="x-btn-text" type="{1}">{0}</button></td></tr>',"</tbody></table></td><td>",'<table cellspacing="0" class="x-btn-wrap x-btn-menu-arrow-wrap"><tbody>','<tr><td class="x-btn-center"><button class="x-btn-menu-arrow-el" type="button">&#160;</button></td><td class="x-btn-right"><i>&#160;</i></td></tr>',"</tbody></table></td></tr></table>");var B=C.append(D,[this.text,this.type],true);var A=B.child("button");if(this.cls){B.addClass(this.cls)}if(this.icon){A.setStyle("background-image","url("+this.icon+")")}if(this.iconCls){A.addClass(this.iconCls);if(!this.cls){B.addClass(this.text?"x-btn-text-icon":"x-btn-icon")}}this.el=B;if(this.handleMouseEvents){B.on("mouseover",this.onMouseOver,this);B.on("mouseout",this.onMouseOut,this);B.on("mousedown",this.onMouseDown,this);B.on("mouseup",this.onMouseUp,this)}B.on(this.clickEvent,this.onClick,this);if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.tips(Ext.apply({target:A.id},this.tooltip))}else{A.dom[this.tooltipType]=this.tooltip}}if(this.arrowTooltip){B.child("button:nth(2)").dom[this.tooltipType]=this.arrowTooltip}if(this.hidden){this.hide()}if(this.disabled){this.disable()}if(this.pressed){this.el.addClass("x-btn-pressed")}if(Ext.isIE&&!Ext.isIE7){this.autoWidth.defer(1,this)}else{this.autoWidth()}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this)}},autoWidth:function(){if(this.el){var C=this.el.child("table:first");var B=this.el.child("table:last");this.el.setWidth("auto");C.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var A=this.el.child("button:first");if(A&&A.getWidth()>20){A.clip();A.setWidth(Ext.util.TextMetrics.measure(A,this.text).width+A.getFrameWidth("lr"))}}if(this.minWidth){if(this.hidden){this.el.beginMeasure()}if((C.getWidth()+B.getWidth())<this.minWidth){C.setWidth(this.minWidth-B.getWidth())}if(this.hidden){this.el.endMeasure()}}this.el.setWidth(C.getWidth()+B.getWidth())}},setHandler:function(B,A){this.handler=B;this.scope=A},setArrowHandler:function(B,A){this.arrowHandler=B;this.scope=A},focus:function(){if(this.el){this.el.child("button:first").focus()}},onClick:function(A){A.preventDefault();if(!this.disabled){if(A.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()){this.menu.show(this.el,this.menuAlign)}this.fireEvent("arrowclick",this,A);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,A)}}else{this.fireEvent("click",this,A);if(this.handler){this.handler.call(this.scope||this,this,A)}}}},onMouseDown:function(A){if(!this.disabled){Ext.fly(A.getTarget("table")).addClass("x-btn-click")}},onMouseUp:function(A){Ext.fly(A.getTarget("table")).removeClass("x-btn-click")}});Ext.MenuButton=Ext.SplitButton;Ext.Toolbar=function(C,B,A){if(C instanceof Array){B=C;A=B;C=null}Ext.apply(this,A);this.buttons=B;if(C){this.render(C)}};Ext.Toolbar.prototype={render:function(B){this.el=Ext.get(B);if(this.cls){this.el.addClass(this.cls)}this.el.update('<div class="x-toolbar x-small-editor"><table cellspacing="0"><tr></tr></table></div>');this.tr=this.el.child("tr",true);var A=0;this.items=new Ext.util.MixedCollection(false,function(C){return C.id||("item"+(++A))});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons}},add:function(){var B=arguments,A=B.length;for(var C=0;C<A;C++){var D=B[C];if(D.applyTo){this.addField(D)}else{if(D.render){this.addItem(D)}else{if(typeof D=="string"){if(D=="separator"||D=="-"){this.addSeparator()}else{if(D==" "){this.addSpacer()}else{if(D=="->"){this.addFill()}else{this.addText(D)}}}}else{if(D.tagName){this.addElement(D)}else{if(typeof D=="object"){this.addButton(D)}}}}}}},getEl:function(){return this.el},addSeparator:function(){return this.addItem(new Ext.Toolbar.Separator())},addSpacer:function(){return this.addItem(new Ext.Toolbar.Spacer())},addFill:function(){return this.addItem(new Ext.Toolbar.Fill())},addElement:function(A){return this.addItem(new Ext.Toolbar.Item(A))},addItem:function(A){var B=this.nextBlock();A.render(B);this.items.add(A);return A},addButton:function(C){if(C instanceof Array){var F=[];for(var D=0,B=C.length;D<B;D++){F.push(this.addButton(C[D]))}return F}var A=C;if(!(C instanceof Ext.Toolbar.Button)){A=C.split?new Ext.Toolbar.SplitButton(C):new Ext.Toolbar.Button(C)}var E=this.nextBlock();A.render(E);this.items.add(A);return A},addText:function(A){return this.addItem(new Ext.Toolbar.TextItem(A))},insertButton:function(E,D){if(D instanceof Array){var B=[];for(var C=0,A=D.length;C<A;C++){B.push(this.insertButton(E+C,D[C]))}return B}if(!(D instanceof Ext.Toolbar.Button)){D=new Ext.Toolbar.Button(D)}var F=document.createElement("td");this.tr.insertBefore(F,this.tr.childNodes[E]);D.render(F);this.items.insert(E,D);return D},addDom:function(B,A){var D=this.nextBlock();Ext.DomHelper.overwrite(D,B);var C=new Ext.Toolbar.Item(D.firstChild);C.render(D);this.items.add(C);return C},addField:function(A){var C=this.nextBlock();A.render(C);var B=new Ext.Toolbar.Item(C.firstChild);B.render(C);this.items.add(B);return B},nextBlock:function(){var A=document.createElement("td");this.tr.appendChild(A);return A},destroy:function(){if(this.items){Ext.destroy.apply(Ext,this.items.items)}Ext.Element.uncache(this.el,this.tr)}};Ext.Toolbar.Item=function(A){this.el=Ext.getDom(A);this.id=Ext.id(this.el);this.hidden=false};Ext.Toolbar.Item.prototype={getEl:function(){return this.el},render:function(A){this.td=A;A.appendChild(this.el)},destroy:function(){this.td.parentNode.removeChild(this.td)},show:function(){this.hidden=false;this.td.style.display=""},hide:function(){this.hidden=true;this.td.style.display="none"},setVisible:function(A){if(A){this.show()}else{this.hide()}},focus:function(){Ext.fly(this.el).focus()},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false}};Ext.Toolbar.Separator=function(){var A=document.createElement("span");A.className="ytb-sep";Ext.Toolbar.Separator.superclass.constructor.call(this,A)};Ext.extend(Ext.Toolbar.Separator,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Spacer=function(){var A=document.createElement("div");A.className="ytb-spacer";Ext.Toolbar.Spacer.superclass.constructor.call(this,A)};Ext.extend(Ext.Toolbar.Spacer,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Fill=Ext.extend(Ext.Toolbar.Spacer,{render:function(A){A.style.width="100%";Ext.Toolbar.Fill.superclass.render.call(this,A)}});Ext.Toolbar.TextItem=function(A){var B=document.createElement("span");B.className="ytb-text";B.innerHTML=A;Ext.Toolbar.TextItem.superclass.constructor.call(this,B)};Ext.extend(Ext.Toolbar.TextItem,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Button=function(A){Ext.Toolbar.Button.superclass.constructor.call(this,null,A)};Ext.extend(Ext.Toolbar.Button,Ext.Button,{render:function(A){this.td=A;Ext.Toolbar.Button.superclass.render.call(this,A)},destroy:function(){Ext.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td)},show:function(){this.hidden=false;this.td.style.display=""},hide:function(){this.hidden=true;this.td.style.display="none"},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false}});Ext.ToolbarButton=Ext.Toolbar.Button;Ext.Toolbar.SplitButton=function(A){Ext.Toolbar.SplitButton.superclass.constructor.call(this,null,A)};Ext.extend(Ext.Toolbar.SplitButton,Ext.SplitButton,{render:function(A){this.td=A;Ext.Toolbar.SplitButton.superclass.render.call(this,A)},destroy:function(){Ext.Toolbar.SplitButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td)},show:function(){this.hidden=false;this.td.style.display=""},hide:function(){this.hidden=true;this.td.style.display="none"}});Ext.Toolbar.MenuButton=Ext.Toolbar.SplitButton;Ext.PagingToolbar=function(A,C,B){Ext.PagingToolbar.superclass.constructor.call(this,A,null,B);this.ds=C;this.cursor=0;this.renderButtons(this.el);this.bind(C)};Ext.extend(Ext.PagingToolbar,Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",renderButtons:function(A){Ext.PagingToolbar.superclass.render.call(this,A);this.first=this.addButton({tooltip:this.firstText,cls:"x-btn-icon x-grid-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,cls:"x-btn-icon x-grid-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.addSeparator();this.add(this.beforePageText);this.field=Ext.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-grid-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select()});this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.addSeparator();this.next=this.addButton({tooltip:this.nextText,cls:"x-btn-icon x-grid-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,cls:"x-btn-icon x-grid-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.addSeparator();this.loading=this.addButton({tooltip:this.refreshText,cls:"x-btn-icon x-grid-loading",handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom.firstChild).createChild({cls:"x-paging-info"})}},updateInfo:function(){if(this.displayEl){var B=this.ds.getCount();var A=B==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+B,this.ds.getTotalCount());this.displayEl.update(A)}},onLoad:function(C,B,F){this.cursor=F.params?F.params.start:0;var E=this.getPageData(),A=E.activePage,D=E.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,E.pages);this.field.dom.value=A;this.first.setDisabled(A==1);this.prev.setDisabled(A==1);this.next.setDisabled(A==D);this.last.setDisabled(A==D);this.loading.enable();this.updateInfo()},getPageData:function(){var A=this.ds.getTotalCount();return{total:A,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:A<this.pageSize?1:Math.ceil(A/this.pageSize)}},onLoadError:function(){this.loading.enable()},onPagingKeydown:function(E){var B=E.getKey();var F=this.getPageData();if(B==E.RETURN){var A=this.field.dom.value,D;if(!A||isNaN(D=parseInt(A,10))){this.field.dom.value=F.activePage;return }D=Math.min(Math.max(1,D),F.pages)-1;this.ds.load({params:{start:D*this.pageSize,limit:this.pageSize}});E.stopEvent()}else{if(B==E.HOME||(B==E.UP&&E.ctrlKey)||(B==E.PAGEUP&&E.ctrlKey)||(B==E.RIGHT&&E.ctrlKey)||B==E.END||(B==E.DOWN&&E.ctrlKey)||(B==E.LEFT&&E.ctrlKey)||(B==E.PAGEDOWN&&E.ctrlKey)){var D=(B==E.HOME||(B==E.DOWN&&E.ctrlKey)||(B==E.LEFT&&E.ctrlKey)||(B==E.PAGEDOWN&&E.ctrlKey))?1:F.pages;this.field.dom.value=D;this.ds.load({params:{start:(D-1)*this.pageSize,limit:this.pageSize}});E.stopEvent()}else{if(B==E.UP||B==E.RIGHT||B==E.PAGEUP||B==E.DOWN||B==E.LEFT||B==E.PAGEDOWN){var A=this.field.dom.value,D;var C=(E.shiftKey)?10:1;if(B==E.DOWN||B==E.LEFT||B==E.PAGEDOWN){C*=-1}if(!A||isNaN(D=parseInt(A,10))){this.field.dom.value=F.activePage;return }else{if(parseInt(A,10)+C>=1&parseInt(A,10)+C<=F.pages){this.field.dom.value=parseInt(A,10)+C;D=Math.min(Math.max(1,D+C),F.pages)-1;this.ds.load({params:{start:D*this.pageSize,limit:this.pageSize}})}}E.stopEvent()}}}},beforeLoad:function(){if(this.loading){this.loading.disable()}},onClick:function(D){var E=this.ds;switch(D){case"first":E.load({params:{start:0,limit:this.pageSize}});break;case"prev":E.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case"next":E.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case"last":var C=E.getTotalCount();var B=C%this.pageSize;var A=B?(C-B):C-this.pageSize;E.load({params:{start:A,limit:this.pageSize}});break;case"refresh":E.load({params:{start:this.cursor,limit:this.pageSize}});break}},unbind:function(A){A.un("beforeload",this.beforeLoad,this);A.un("load",this.onLoad,this);A.un("loadexception",this.onLoadError,this);this.ds=undefined},bind:function(A){A.on("beforeload",this.beforeLoad,this);A.on("load",this.onLoad,this);A.on("loadexception",this.onLoadError,this);this.ds=A}});Ext.Resizable=function(D,L){this.el=Ext.get(D);if(L&&L.wrap){L.resizeChild=this.el;this.el=this.el.wrap(typeof L.wrap=="object"?L.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=L.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(L.resizeChild.getPositioning());L.resizeChild.clearPositioning();if(!L.width||!L.height){var K=L.resizeChild.getSize();this.el.setSize(K.width,K.height)}if(L.pinned&&!L.adjustments){L.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"});this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,L);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var J=this.el.getStyle("position");if(J!="absolute"&&J!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var M=this.handles.split(/\s*?[,;]\s*?| /);var C=Ext.Resizable.positions;for(var F=0,H=M.length;F<H;F++){if(M[F]&&C[M[F]]){var G=C[M[F]];this[G]=new Ext.Resizable.Handle(this,G,this.disableTrackOver,this.transparent)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var B=this.resizeChild;var I=this.west,E=this.east,A=this.north,M=this.south;if(B&&(I||A)){B.position("relative");B.setLeft(I?I.el.getWidth():0);B.setTop(A?A.el.getHeight():0)}this.adjustments=[(E?-E.el.getWidth():0)+(I?-I.el.getWidth():0),(A?-A.el.getHeight():0)+(M?-M.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id)}this.addEvents({"beforeresize":true,"resize":true});if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)};Ext.extend(Ext.Resizable,Ext.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:0.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:"easeOutStrong",widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,constrainTo:undefined,resizeRegion:undefined,resizeTo:function(A,B){this.el.setSize(A,B);this.updateChildSize();this.fireEvent("resize",this,A,B,null)},startSizing:function(B,C){this.fireEvent("beforeresize",this,B);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"});this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this)}this.overlay.setStyle("cursor",C.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=B.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var A=Ext.get(this.constrainTo);this.resizeRegion=A.getRegion().adjust(A.getFrameWidth("t"),A.getFrameWidth("l"),-A.getFrameWidth("b"),-A.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(A,B){if(this.enabled){B.stopEvent();this.activeHandle=A;this.startSizing(B,A)}},onMouseUp:function(B){var A=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,A.width,A.height,B)},updateChildSize:function(){if(this.resizeChild){var D=this.el;var C=this.resizeChild;var B=this.adjustments;if(D.dom.offsetWidth){var A=D.getSize(true);C.setSize(A.width+B[0],A.height+B[1])}if(Ext.isIE){setTimeout(function(){if(D.dom.offsetWidth){var E=D.getSize(true);C.setSize(E.width+B[0],E.height+B[1])}},10)}}},snap:function(C,E,D){if(!E||!C){return C}var B=C;var A=C%E;if(A>0){if(A>(E/2)){B=C+(E-A)}else{B=C-A}}return Math.max(D,B)},resizeElement:function(){var A=this.proxy.getBox();if(this.updateBox){this.el.setBox(A,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(A.width,A.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}return A},constrain:function(B,D,A,C){if(B-D<A){D=B-A}else{if(B-D>C){D=C-B}}return D},onMouseMove:function(T){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(T.getPoint())){return }var H=this.curSize||this.startBox;var J=this.startBox.x,I=this.startBox.y;var C=J,B=I;var K=H.width,S=H.height;var D=K,M=S;var L=this.minWidth,U=this.minHeight;var O=this.maxWidth,W=this.maxHeight;var F=this.widthIncrement;var A=this.heightIncrement;var R=T.getXY();var Q=-(this.startPoint[0]-Math.max(this.minX,R[0]));var P=-(this.startPoint[1]-Math.max(this.minY,R[1]));var G=this.activeHandle.position;switch(G){case"east":K+=Q;K=Math.min(Math.max(L,K),O);break;case"south":S+=P;S=Math.min(Math.max(U,S),W);break;case"southeast":K+=Q;S+=P;K=Math.min(Math.max(L,K),O);S=Math.min(Math.max(U,S),W);break;case"north":P=this.constrain(S,P,U,W);I+=P;S-=P;break;case"west":Q=this.constrain(K,Q,L,O);J+=Q;K-=Q;break;case"northeast":K+=Q;K=Math.min(Math.max(L,K),O);P=this.constrain(S,P,U,W);I+=P;S-=P;break;case"northwest":Q=this.constrain(K,Q,L,O);P=this.constrain(S,P,U,W);I+=P;S-=P;J+=Q;K-=Q;break;case"southwest":Q=this.constrain(K,Q,L,O);S+=P;S=Math.min(Math.max(U,S),W);J+=Q;K-=Q;break}var N=this.snap(K,F,L);var V=this.snap(S,A,U);if(N!=K||V!=S){switch(G){case"northeast":I-=V-S;break;case"north":I-=V-S;break;case"southwest":J-=N-K;break;case"west":J-=N-K;break;case"northwest":J-=N-K;I-=V-S;break}K=N;S=V}if(this.preserveRatio){switch(G){case"southeast":case"east":S=M*(K/D);S=Math.min(Math.max(U,S),W);K=D*(S/M);break;case"south":K=D*(S/M);K=Math.min(Math.max(L,K),O);S=M*(K/D);break;case"northeast":K=D*(S/M);K=Math.min(Math.max(L,K),O);S=M*(K/D);break;case"north":var X=K;K=D*(S/M);K=Math.min(Math.max(L,K),O);S=M*(K/D);J+=(X-K)/2;break;case"southwest":S=M*(K/D);S=Math.min(Math.max(U,S),W);var X=K;K=D*(S/M);J+=X-K;break;case"west":var E=S;S=M*(K/D);S=Math.min(Math.max(U,S),W);I+=(E-S)/2;var X=K;K=D*(S/M);J+=X-K;break;case"northwest":var X=K;var E=S;S=M*(K/D);S=Math.min(Math.max(U,S),W);K=D*(S/M);I+=E-S;J+=X-K;break}}this.proxy.setBounds(J,I,K,S);if(this.dynamic){this.resizeElement()}}catch(T){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(C){this.proxy.remove();if(this.overlay){this.overlay.removeAllListeners();this.overlay.remove()}var D=Ext.Resizable.positions;for(var A in D){if(typeof D[A]!="function"&&this[D[A]]){var B=this[D[A]];B.el.removeAllListeners();B.el.remove()}}if(C){this.el.update("");this.el.remove()}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=function(D,E,B,A){if(!this.tpl){var C=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});C.compile();Ext.Resizable.Handle.prototype.tpl=C}this.position=E;this.rz=D;this.el=this.tpl.append(D.el.dom,[this.position],true);this.el.unselectable();if(A){this.el.setOpacity(0)}this.el.on("mousedown",this.onMouseDown,this);if(!B){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this)}};Ext.Resizable.Handle.prototype={afterResize:function(A){},onMouseDown:function(A){this.rz.onMouseDown(this,A)},onMouseOver:function(A){this.rz.handleOver(this,A)},onMouseOut:function(A){this.rz.handleOut(this,A)}};Ext.Editor=function(B,A){Ext.Editor.superclass.constructor.call(this,A);this.field=B;this.addEvents({"beforestartedit":true,"startedit":true,"beforecomplete":true,"complete":true,"specialkey":true})};Ext.extend(Ext.Editor,Ext.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,completeOnEnter:false,cancelOnEsc:false,updateEl:false,onRender:function(A,B){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:A,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.render(this.el);if(Ext.isGecko){this.field.el.dom.setAttribute("autocomplete","off")}this.field.on("specialkey",this.onSpecialKey,this);if(this.swallowKeys){this.field.el.swallowEvent(["keydown","keypress"])}this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1})}},onSpecialKey:function(A,B){if(this.completeOnEnter&&B.getKey()==B.ENTER){B.stopEvent();this.completeEdit()}else{if(this.cancelOnEsc&&B.getKey()==B.ESC){this.cancelEdit()}else{this.fireEvent("specialkey",A,B)}}},startEdit:function(C,A){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(C);var B=A!==undefined?A:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,B)===false){return }this.startValue=B;this.field.setValue(B);if(this.autoSize){var D=this.boundEl.getSize();switch(this.autoSize){case"width":this.setSize(D.width,"");break;case"height":this.setSize("",D.height);break;default:this.setSize(D.width,D.height)}}this.el.alignTo(this.boundEl,this.alignment);this.editing=true;if(Ext.QuickTips){Ext.QuickTips.disable()}this.show()},setSize:function(A,B){this.field.setSize(A,B);if(this.el){this.el.sync()}},realign:function(){this.el.alignTo(this.boundEl,this.alignment)},completeEdit:function(A){if(!this.editing){return }var B=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){B=this.startValue;this.cancelEdit(true)}if(String(B)==String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return }if(this.fireEvent("beforecomplete",this,B,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(B)}if(A!==true){this.hide()}this.fireEvent("complete",this,B,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show();if(Ext.isIE&&!this.fixIEFocus){this.fixIEFocus=true;this.deferredFocus.defer(50,this)}else{this.field.focus()}this.fireEvent("startedit",this.boundEl,this.startValue)},deferredFocus:function(){if(this.editing){this.field.focus()}},cancelEdit:function(A){if(this.editing){this.setValue(this.startValue);if(A!==true){this.hide()}}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return }this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}if(Ext.QuickTips){Ext.QuickTips.enable()}},setValue:function(A){this.field.setValue(A)},getValue:function(){return this.field.getValue()}});Ext.BasicDialog=function(B,D){this.el=Ext.get(B);var C=Ext.DomHelper;if(!this.el&&D&&D.autoCreate){if(typeof D.autoCreate=="object"){if(!D.autoCreate.id){D.autoCreate.id=B}this.el=C.append(document.body,D.autoCreate,true)}else{this.el=C.append(document.body,{tag:"div",id:B,style:"visibility:hidden;"},true)}}B=this.el;B.setDisplayed(true);B.hide=this.hideAction;this.id=B.id;B.addClass("x-dlg");Ext.apply(this,D);this.proxy=B.createProxy("x-dlg-proxy");this.proxy.hide=this.hideAction;this.proxy.setOpacity(0.5);this.proxy.hide();if(D.width){B.setWidth(D.width)}if(D.height){B.setHeight(D.height)}this.size=B.getSize();if(typeof D.x!="undefined"&&typeof D.y!="undefined"){this.xy=[D.x,D.y]}else{this.xy=B.getCenterXY(true)}this.header=B.child("> .x-dlg-hd");this.body=B.child("> .x-dlg-bd");this.footer=B.child("> .x-dlg-ft");if(!this.header){this.header=B.createChild({tag:"div",cls:"x-dlg-hd",html:"&#160;"},this.body?this.body.dom:null)}if(!this.body){this.body=B.createChild({tag:"div",cls:"x-dlg-bd"})}this.header.unselectable();if(this.title){this.header.update(this.title)}this.focusEl=B.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1"});this.focusEl.swallowEvent("click",true);this.header.wrap({cls:"x-dlg-hd-right"}).wrap({cls:"x-dlg-hd-left"},true);this.bwrap=this.body.wrap({tag:"div",cls:"x-dlg-dlg-body"});if(this.footer){this.bwrap.dom.appendChild(this.footer.dom)}this.bg=this.el.createChild({tag:"div",cls:"x-dlg-bg",html:'<div class="x-dlg-bg-left"><div class="x-dlg-bg-right"><div class="x-dlg-bg-center">&#160;</div></div></div>'});this.centerBg=this.bg.child("div.x-dlg-bg-center");if(this.autoScroll!==false&&!this.autoTabs){this.body.setStyle("overflow","auto")}this.toolbox=this.el.createChild({cls:"x-dlg-toolbox"});if(this.closable!==false){this.el.addClass("x-dlg-closable");this.close=this.toolbox.createChild({cls:"x-dlg-close"});this.close.on("click",this.closeClick,this);this.close.addClassOnOver("x-dlg-close-over")}if(this.collapsible!==false){this.collapseBtn=this.toolbox.createChild({cls:"x-dlg-collapse"});this.collapseBtn.on("click",this.collapseClick,this);this.collapseBtn.addClassOnOver("x-dlg-collapse-over");this.header.on("dblclick",this.collapseClick,this)}if(this.resizable!==false){this.el.addClass("x-dlg-resizable");this.resizer=new Ext.Resizable(B,{minWidth:this.minWidth||80,minHeight:this.minHeight||80,handles:this.resizeHandles||"all",pinned:true});this.resizer.on("beforeresize",this.beforeResize,this);this.resizer.on("resize",this.onResize,this)}if(this.draggable!==false){B.addClass("x-dlg-draggable");if(!this.proxyDrag){var A=new Ext.dd.DD(B.dom.id,"WindowDrag")}else{var A=new Ext.dd.DDProxy(B.dom.id,"WindowDrag",{dragElId:this.proxy.id})}A.setHandleElId(this.header.id);A.endDrag=this.endMove.createDelegate(this);A.startDrag=this.startMove.createDelegate(this);A.onDrag=this.onDrag.createDelegate(this);A.scroll=false;this.dd=A}if(this.modal){this.mask=C.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);this.mask.enableDisplayMode("block");this.mask.hide();this.el.addClass("x-dlg-modal")}if(this.shadow){this.shadow=new Ext.Shadow({mode:typeof this.shadow=="string"?this.shadow:"sides",offset:this.shadowOffset})}else{this.shadowOffset=0}if(Ext.useShims&&this.shim!==false){this.shim=this.el.createShim();this.shim.hide=this.hideAction;this.shim.hide()}else{this.shim=false}if(this.autoTabs){this.initTabs()}this.addEvents({"keydown":true,"move":true,"resize":true,"beforehide":true,"hide":true,"beforeshow":true,"show":true});B.on("keydown",this.onKeyDown,this);B.on("mousedown",this.toFront,this);Ext.EventManager.onWindowResize(this.adjustViewport,this,true);this.el.hide();Ext.DialogManager.register(this);Ext.BasicDialog.superclass.constructor.call(this)};Ext.extend(Ext.BasicDialog,Ext.util.Observable,{shadowOffset:Ext.isIE?6:5,minHeight:80,minWidth:200,minButtonWidth:75,defaultButton:null,buttonAlign:"right",tabTag:"div",firstShow:true,setTitle:function(A){this.header.update(A);return this},closeClick:function(){this.hide()},collapseClick:function(){this[this.collapsed?"expand":"collapse"]()},collapse:function(){if(!this.collapsed){this.collapsed=true;this.el.addClass("x-dlg-collapsed");this.restoreHeight=this.el.getHeight();this.resizeTo(this.el.getWidth(),this.header.getHeight())}},expand:function(){if(this.collapsed){this.collapsed=false;this.el.removeClass("x-dlg-collapsed");this.resizeTo(this.el.getWidth(),this.restoreHeight)}},initTabs:function(){var A=this.getTabs();while(A.getTab(0)){A.removeTab(0)}this.el.select(this.tabTag+".x-dlg-tab").each(function(C){var B=C.dom;A.addTab(Ext.id(B),B.title);B.title=""});A.activate(0);return A},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getHeaderFooterHeight(true)+40)},onResize:function(){this.refreshSize();this.syncBodyHeight();this.adjustAssets();this.focus();this.fireEvent("resize",this,this.size.width,this.size.height)},onKeyDown:function(A){if(this.isVisible()){this.fireEvent("keydown",this,A)}},resizeTo:function(B,A){this.el.setSize(B,A);this.size={width:B,height:A};this.syncBodyHeight();if(this.fixedcenter){this.center()}if(this.isVisible()){this.constrainXY();this.adjustAssets()}this.fireEvent("resize",this,B,A);return this},setContentSize:function(A,B){B+=this.getHeaderFooterHeight()+this.body.getMargins("tb");A+=this.body.getMargins("lr")+this.bwrap.getMargins("lr")+this.centerBg.getPadding("lr");B+=this.body.getPadding("tb")+this.bwrap.getBorderWidth("tb")+this.body.getBorderWidth("tb")+this.el.getBorderWidth("tb");A+=this.body.getPadding("lr")+this.bwrap.getBorderWidth("lr")+this.body.getBorderWidth("lr")+this.bwrap.getPadding("lr")+this.el.getBorderWidth("lr");if(this.tabs){B+=this.tabs.stripWrap.getHeight()+this.tabs.bodyEl.getMargins("tb")+this.tabs.bodyEl.getPadding("tb");A+=this.tabs.bodyEl.getMargins("lr")+this.tabs.bodyEl.getPadding("lr")}this.resizeTo(A,B);return this},addKeyListener:function(A,C,H){var G,F,D,E;if(typeof A=="object"&&!(A instanceof Array)){G=A["key"];F=A["shift"];D=A["ctrl"];E=A["alt"]}else{G=A}var B=function(M,L){if((!F||L.shiftKey)&&(!D||L.ctrlKey)&&(!E||L.altKey)){var J=L.getKey();if(G instanceof Array){for(var K=0,I=G.length;K<I;K++){if(G[K]==J){C.call(H||window,M,J,L);return }}}else{if(J==G){C.call(H||window,M,J,L)}}}};this.on("keydown",B);return this},getTabs:function(){if(!this.tabs){this.el.addClass("x-dlg-auto-tabs");this.body.addClass(this.tabPosition=="bottom"?"x-tabs-bottom":"x-tabs-top");this.tabs=new Ext.TabPanel(this.body.dom,this.tabPosition=="bottom")}return this.tabs},addButton:function(F,D,C){var G=Ext.DomHelper;if(!this.footer){this.footer=G.append(this.bwrap,{tag:"div",cls:"x-dlg-ft"},true)}if(!this.btnContainer){var B=this.footer.createChild({cls:"x-dlg-btns x-dlg-btns-"+this.buttonAlign,html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'},null,true);this.btnContainer=B.firstChild.firstChild.firstChild}var A={handler:D,scope:C,minWidth:this.minButtonWidth,hideParent:true};if(typeof F=="string"){A.text=F}else{if(F.tag){A.dhconfig=F}else{Ext.apply(A,F)}}var E=new Ext.Button(this.btnContainer.appendChild(document.createElement("td")),A);this.syncBodyHeight();if(!this.buttons){this.buttons=[]}this.buttons.push(E);return E},setDefaultButton:function(A){this.defaultButton=A;return this},getHeaderFooterHeight:function(C){var B=0;if(this.header){B+=this.header.getHeight()}if(this.footer){var A=this.footer.getMargins();B+=(this.footer.getHeight()+A.top+A.bottom)}B+=this.bwrap.getPadding("tb")+this.bwrap.getBorderWidth("tb");B+=this.centerBg.getPadding("tb");return B},syncBodyHeight:function(){var E=this.body,A=this.centerBg,F=this.bwrap;var B=this.size.height-this.getHeaderFooterHeight(false);E.setHeight(B-E.getMargins("tb"));var C=this.header.getHeight();var D=this.size.height-C;A.setHeight(D);F.setLeftTop(A.getPadding("l"),C+A.getPadding("t"));F.setHeight(D-A.getPadding("tb"));F.setWidth(this.el.getWidth(true)-A.getPadding("lr"));E.setWidth(F.getWidth(true));if(this.tabs){this.tabs.syncHeight();if(Ext.isIE){this.tabs.el.repaint()}}},restoreState:function(){var A=Ext.state.Manager.get(this.stateId||(this.el.id+"-state"));if(A&&A.width){this.xy=[A.x,A.y];this.resizeTo(A.width,A.height)}return this},beforeShow:function(){this.expand();if(this.fixedcenter){this.xy=this.el.getCenterXY(true)}if(this.modal){Ext.get(document.body).addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}this.constrainXY()},animShow:function(){var A=Ext.get(this.animateTarget,true).getBox();this.proxy.setSize(A.width,A.height);this.proxy.setLocation(A.x,A.y);this.proxy.show();this.proxy.setBounds(this.xy[0],this.xy[1],this.size.width,this.size.height,true,0.35,this.showEl.createDelegate(this))},show:function(A){if(this.fireEvent("beforeshow",this)===false){return }if(this.syncHeightBeforeShow){this.syncBodyHeight()}else{if(this.firstShow){this.firstShow=false;this.syncBodyHeight()}}this.animateTarget=A||this.animateTarget;if(!this.el.isVisible()){this.beforeShow();if(this.animateTarget){this.animShow()}else{this.showEl()}}return this},showEl:function(){this.proxy.hide();this.el.setXY(this.xy);this.el.show();this.adjustAssets(true);this.toFront();this.focus();if(Ext.isIE){this.el.repaint()}this.fireEvent("show",this)},focus:function(){if(this.defaultButton){this.defaultButton.focus()}else{this.focusEl.focus()}},constrainXY:function(){if(this.constraintoviewport!==false){if(!this.viewSize){if(this.container){var D=this.container.getSize();this.viewSize=[D.width,D.height]}else{this.viewSize=[Ext.lib.Dom.getViewWidth(),Ext.lib.Dom.getViewHeight()]}}var D=Ext.get(this.container||document).getScroll();var A=this.xy[0],H=this.xy[1];var B=this.size.width,C=this.size.height;var E=this.viewSize[0],G=this.viewSize[1];var F=false;if(A+B>E+D.left){A=E-B;F=true}if(H+C>G+D.top){H=G-C;F=true}if(A<D.left){A=D.left;F=true}if(H<D.top){H=D.top;F=true}if(F){this.xy=[A,H];if(this.isVisible()){this.el.setLocation(A,H);this.adjustAssets()}}}},onDrag:function(){if(!this.proxyDrag){this.xy=this.el.getXY();this.adjustAssets()}},adjustAssets:function(D){var A=this.xy[0],E=this.xy[1];var B=this.size.width,C=this.size.height;if(D===true){if(this.shadow){this.shadow.show(this.el)}if(this.shim){this.shim.show()}}if(this.shadow&&this.shadow.isVisible()){this.shadow.show(this.el)}if(this.shim&&this.shim.isVisible()){this.shim.setBounds(A,E,B,C)}},adjustViewport:function(A,B){if(!A||!B){A=Ext.lib.Dom.getViewWidth();B=Ext.lib.Dom.getViewHeight()}this.viewSize=[A,B];if(this.modal&&this.mask.isVisible()){this.mask.setSize(A,B);this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}if(this.isVisible()){this.constrainXY()}},destroy:function(C){if(this.isVisible()){this.animateTarget=null;this.hide()}Ext.EventManager.removeResizeListener(this.adjustViewport,this);if(this.tabs){this.tabs.destroy(C)}Ext.destroy(this.shim,this.proxy,this.resizer,this.close,this.mask);if(this.dd){this.dd.unreg()}if(this.buttons){for(var B=0,A=this.buttons.length;B<A;B++){this.buttons[B].destroy()}}this.el.removeAllListeners();if(C===true){this.el.update("");this.el.remove()}Ext.DialogManager.unregister(this)},startMove:function(){if(this.proxyDrag){this.proxy.show()}if(this.constraintoviewport!==false){this.dd.constrainTo(document.body,{right:this.shadowOffset,bottom:this.shadowOffset})}},endMove:function(){if(!this.proxyDrag){Ext.dd.DD.prototype.endDrag.apply(this.dd,arguments)}else{Ext.dd.DDProxy.prototype.endDrag.apply(this.dd,arguments);this.proxy.hide()}this.refreshSize();this.adjustAssets();this.focus();this.fireEvent("move",this,this.xy[0],this.xy[1])},toFront:function(){Ext.DialogManager.bringToFront(this);return this},toBack:function(){Ext.DialogManager.sendToBack(this);return this},center:function(){var A=this.el.getCenterXY(true);this.moveTo(A[0],A[1]);return this},moveTo:function(A,B){this.xy=[A,B];if(this.isVisible()){this.el.setXY(this.xy);this.adjustAssets()}return this},alignTo:function(B,A,C){this.xy=this.el.getAlignToXY(B,A,C);if(this.isVisible()){this.el.setXY(this.xy);this.adjustAssets()}return this},anchorTo:function(C,E,D,A){var F=function(){this.alignTo(C,E,D)};Ext.EventManager.onWindowResize(F,this);var B=typeof A;if(B!="undefined"){Ext.EventManager.on(window,"scroll",F,this,{buffer:B=="number"?A:50})}F.call(this);return this},isVisible:function(){return this.el.isVisible()},animHide:function(B){var A=Ext.get(this.animateTarget).getBox();this.proxy.show();this.proxy.setBounds(this.xy[0],this.xy[1],this.size.width,this.size.height);this.el.hide();this.proxy.setBounds(A.x,A.y,A.width,A.height,true,0.35,this.hideEl.createDelegate(this,[B]))},hide:function(A){if(this.fireEvent("beforehide",this)===false){return }if(this.shadow){this.shadow.hide()}if(this.shim){this.shim.hide()}if(this.animateTarget){this.animHide(A)}else{this.el.hide();this.hideEl(A)}return this},hideEl:function(A){this.proxy.hide();if(this.modal){this.mask.hide();Ext.get(document.body).removeClass("x-body-masked")}this.fireEvent("hide",this);if(typeof A=="function"){A()}},hideAction:function(){this.setLeft("-10000px");this.setTop("-10000px");this.setStyle("visibility","hidden")},refreshSize:function(){this.size=this.el.getSize();this.xy=this.el.getXY();Ext.state.Manager.set(this.stateId||this.el.id+"-state",this.el.getBox())},setZIndex:function(A){if(this.modal){this.mask.setStyle("z-index",A)}if(this.shim){this.shim.setStyle("z-index",++A)}if(this.shadow){this.shadow.setZIndex(++A)}this.el.setStyle("z-index",++A);if(this.proxy){this.proxy.setStyle("z-index",++A)}if(this.resizer){this.resizer.proxy.setStyle("z-index",++A)}this.lastZIndex=A},getEl:function(){return this.el}});Ext.DialogManager=function(){var D={};var C=[];var B=null;var A=function(G,F){return(!G._lastAccess||G._lastAccess<F._lastAccess)?-1:1};var E=function(){C.sort(A);var I=Ext.DialogManager.zseed;for(var G=0,F=C.length;G<F;G++){var H=C[G];if(H){H.setZIndex(I+(G*10))}}};return{zseed:9000,register:function(F){D[F.id]=F;C.push(F)},unregister:function(H){delete D[H.id];if(!C.indexOf){for(var G=0,F=C.length;G<F;G++){if(C[G]==H){C.splice(G,1);return }}}else{var G=C.indexOf(H);if(G!=-1){C.splice(G,1)}}},get:function(F){return typeof F=="object"?F:D[F]},bringToFront:function(F){F=this.get(F);if(F!=B){B=F;F._lastAccess=new Date().getTime();E()}return F},sendToBack:function(F){F=this.get(F);F._lastAccess=-(new Date().getTime());E();return F},hideAll:function(){for(var F in D){if(D[F]&&typeof D[F]!="function"&&D[F].isVisible()){D[F].hide()}}}}}();Ext.LayoutDialog=function(B,A){A.autoTabs=false;Ext.LayoutDialog.superclass.constructor.call(this,B,A);this.body.setStyle({overflow:"hidden",position:"relative"});this.layout=new Ext.BorderLayout(this.body.dom,A);this.layout.monitorWindowResize=false;this.el.addClass("x-dlg-auto-layout");this.center=Ext.BasicDialog.prototype.center;this.on("show",this.layout.layout,this.layout,true)};Ext.extend(Ext.LayoutDialog,Ext.BasicDialog,{endUpdate:function(){this.layout.endUpdate()},beginUpdate:function(){this.layout.beginUpdate()},getLayout:function(){return this.layout},showEl:function(){Ext.LayoutDialog.superclass.showEl.apply(this,arguments);if(Ext.isIE7){this.layout.layout()}},syncBodyHeight:function(){Ext.LayoutDialog.superclass.syncBodyHeight.call(this);if(this.layout){this.layout.layout()}}});Ext.MessageBox=function(){var Q,P,O,N;var L,J,H,F,D,A;var M,K,I;var G=function(R){Q.hide();Ext.callback(P.fn,P.scope||window,[R,K.dom.value],1)};var E=function(){if(P&&P.cls){Q.el.removeClass(P.cls)}if(N){Ext.TaskMgr.stop(N);N=null}};var C=function(R){var T=0;if(!R){M["ok"].hide();M["cancel"].hide();M["yes"].hide();M["no"].hide();Q.footer.dom.style.display="none";return T}Q.footer.dom.style.display="";for(var S in M){if(typeof M[S]!="function"){if(R[S]){M[S].show();M[S].setText(typeof R[S]=="string"?R[S]:Ext.MessageBox.buttonText[S]);T+=M[S].el.getWidth()+15}else{M[S].hide()}}}return T};var B=function(T,R,S){if(P&&P.closable!==false){Q.hide()}if(S){S.stopEvent()}};return{getDialog:function(){if(!Q){Q=new Ext.BasicDialog("x-msg-box",{autoCreate:true,shadow:true,draggable:true,resizable:false,constraintoviewport:false,fixedcenter:true,collapsible:false,shim:true,modal:true,width:400,height:100,buttonAlign:"center",closeClick:function(){if(P&&P.buttons&&P.buttons.no&&!P.buttons.cancel){G("no")}else{G("cancel")}}});Q.on("hide",E);O=Q.mask;Q.addKeyListener(27,B);M={};var S=this.buttonText;M["ok"]=Q.addButton(S["ok"],G.createCallback("ok"));M["yes"]=Q.addButton(S["yes"],G.createCallback("yes"));M["no"]=Q.addButton(S["no"],G.createCallback("no"));M["cancel"]=Q.addButton(S["cancel"],G.createCallback("cancel"));L=Q.body.createChild({html:'<span class="ext-mb-text"></span><br /><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea><div class="ext-mb-progress-wrap"><div class="ext-mb-progress"><div class="ext-mb-progress-bar">&#160;</div></div></div>'});J=L.dom.firstChild;H=Ext.get(L.dom.childNodes[2]);H.enableDisplayMode();H.addKeyListener([10,13],function(){if(Q.isVisible()&&P&&P.buttons){if(P.buttons.ok){G("ok")}else{if(P.buttons.yes){G("yes")}}}});F=Ext.get(L.dom.childNodes[3]);F.enableDisplayMode();D=Ext.get(L.dom.childNodes[4]);D.enableDisplayMode();var R=D.dom.firstChild;A=Ext.get(R.firstChild);A.setHeight(R.offsetHeight)}return Q},updateText:function(S){if(!Q.isVisible()&&!P.width){Q.resizeTo(this.maxWidth,100)}J.innerHTML=S||"&#160;";var R=Math.max(Math.min(P.width||J.offsetWidth,this.maxWidth),Math.max(P.minWidth||this.minWidth,I));if(P.prompt){K.setWidth(R)}if(Q.isVisible()){Q.fixedcenter=false}Q.setContentSize(R,L.getHeight());if(Q.isVisible()){Q.fixedcenter=true}return this},updateProgress:function(S,R){if(R){this.updateText(R)}A.setWidth(Math.floor(S*D.dom.firstChild.offsetWidth));return this},isVisible:function(){return Q&&Q.isVisible()},hide:function(){if(this.isVisible()){Q.hide()}},show:function(R){if(this.isVisible()){this.hide()}var U=this.getDialog();P=R;U.setTitle(P.title||"&#160;");U.close.setDisplayed(P.closable!==false);K=H;P.prompt=P.prompt||(P.multiline?true:false);if(P.prompt){if(P.multiline){H.hide();F.show();F.setHeight(typeof P.multiline=="number"?P.multiline:this.defaultTextHeight);K=F}else{H.show();F.hide()}}else{H.hide();F.hide()}D.setDisplayed(P.progress===true);this.updateProgress(0);K.dom.value=P.value||"";if(P.prompt){Q.setDefaultButton(K)}else{var T=P.buttons;var S=null;if(T&&T.ok){S=M["ok"]}else{if(T&&T.yes){S=M["yes"]}}Q.setDefaultButton(S)}I=C(P.buttons);this.updateText(P.msg);if(P.cls){U.el.addClass(P.cls)}U.proxyDrag=P.proxyDrag===true;U.modal=P.modal!==false;U.mask=P.modal!==false?O:false;if(!U.isVisible()){document.body.appendChild(Q.el.dom);U.animateTarget=null;U.show(R.animEl)}return this},progress:function(S,R){this.show({title:S,msg:R,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth});return this},alert:function(T,U,S,R){this.show({title:T,msg:U,buttons:this.OK,fn:S,scope:R});return this},wait:function(S,R){this.show({title:R,msg:S,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});N=Ext.TaskMgr.start({run:function(T){Ext.MessageBox.updateProgress(((((T+20)%20)+1)*5)*0.01)},interval:1000});return this},confirm:function(T,U,S,R){this.show({title:T,msg:U,buttons:this.YESNO,fn:S,scope:R});return this},prompt:function(S,U,T,R,V){this.show({title:S,msg:U,buttons:this.OKCANCEL,fn:T,minWidth:250,scope:R,prompt:true,multiline:V});return this},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.QuickTips=function(){var E,W,T,Q,M,O,N,K={},H,X=null,U,R;var g,S,V,k;var P=false,L=true,J=false;var G=1,F=1,D=1,C=[];var A=function(q){if(L){return }var l=q.getTarget();if(!l||l.nodeType!==1||l==document||l==document.body){return }if(g&&l==g.el){clearTimeout(F);return }if(l&&K[l.id]){K[l.id].el=l;G=I.defer(M.showDelay,M,[K[l.id]]);return }var n,o=Ext.fly(l);var m=O.namespace;if(M.interceptTitles&&l.title){n=l.title;l.qtip=n;l.removeAttribute("title");q.preventDefault()}else{n=l.qtip||o.getAttributeNS(m,O.attribute)}if(n){G=I.defer(M.showDelay,M,[{el:l,text:n,width:o.getAttributeNS(m,O.width),autoHide:o.getAttributeNS(m,O.hide)!="user",title:o.getAttributeNS(m,O.title),cls:o.getAttributeNS(m,O.cls)}])}};var B=function(m){clearTimeout(G);var l=m.getTarget();if(l&&g&&g.el==l&&(M.autoHide&&g.autoHide!==false)){F=setTimeout(e,M.hideDelay)}};var d=function(l){if(L){return }V=l.getXY();V[1]+=18;if(M.trackMouse&&g){E.setXY(V)}};var c=function(l){clearTimeout(G);clearTimeout(F);if(!l.within(E)){if(M.hideOnClick){e();M.disable()}}};var a=function(l){M.enable()};var Y=function(){return U.getPadding("l")+R.getPadding("r")};var I=function(q){if(L){return }clearTimeout(D);g=q;if(X){E.removeClass(X);X=null}if(g.cls){E.addClass(g.cls);X=g.cls}if(g.title){Q.update(g.title);Q.show()}else{Q.update("");Q.hide()}E.dom.style.width=M.maxWidth+"px";T.update(q.text);var n=Y(),l=g.width;if(!l){var s=T.dom;var m=Math.max(s.offsetWidth,s.clientWidth,s.scrollWidth);if(m>M.maxWidth){l=M.maxWidth}else{if(m<M.minWidth){l=M.minWidth}else{l=m}}}E.setWidth(parseInt(l,10)+n);if(g.autoHide===false){N.setDisplayed(true);if(k){k.unlock()}}else{N.setDisplayed(false);if(k){k.lock()}}if(V){E.avoidY=V[1]-18;E.setXY(V)}if(M.animate){E.setOpacity(0.1);E.setStyle("visibility","visible");E.fadeIn({callback:Z})}else{Z()}};var Z=function(){if(g){E.show();H.enable();if(M.autoDismiss&&g.autoHide!==false){D=setTimeout(e,M.autoDismissDelay)}}};var e=function(l){clearTimeout(D);clearTimeout(F);g=null;if(E.isVisible()){H.disable();if(l!==true&&M.animate){E.fadeOut({callback:h})}else{h()}}};var h=function(){E.hide();if(X){E.removeClass(X);X=null}};return{minWidth:40,maxWidth:300,interceptTitles:false,trackMouse:false,hideOnClick:true,showDelay:500,hideDelay:200,autoHide:true,autoDismiss:true,autoDismissDelay:5000,animate:false,init:function(){M=Ext.QuickTips;O=M.tagConfig;if(!J){if(!Ext.isReady){Ext.onReady(Ext.QuickTips.init,Ext.QuickTips);return }E=new Ext.Layer({cls:"x-tip",shadow:"drop",shim:true,constrain:true,shadowOffset:4});E.fxDefaults={stopFx:true};E.update('<div class="x-tip-top-left"><div class="x-tip-top-right"><div class="x-tip-top"></div></div></div><div class="x-tip-bd-left"><div class="x-tip-bd-right"><div class="x-tip-bd"><div class="x-tip-close"></div><h3></h3><div class="x-tip-bd-inner"></div><div class="x-clear"></div></div></div></div><div class="x-tip-ft-left"><div class="x-tip-ft-right"><div class="x-tip-ft"></div></div></div>');Q=E.child("h3");Q.enableDisplayMode("block");W=E.child("div.x-tip-bd");T=E.child("div.x-tip-bd-inner");U=E.child("div.x-tip-bd-left");R=E.child("div.x-tip-bd-right");N=E.child("div.x-tip-close");N.enableDisplayMode("block");N.on("click",e);var l=Ext.get(document.body);l.on("mousedown",c);l.on("mouseup",a);l.on("mouseover",A);l.on("mouseout",B);l.on("mousemove",d);H=l.addKeyListener(27,e);H.disable();if(Ext.dd.DD){k=E.initDD("default",null,{onDrag:function(){E.sync()}});k.setHandleElId(Q.id);k.lock()}J=true}this.enable()},register:function(m){var q=m instanceof Array?m:arguments;for(var o=0,l=q.length;o<l;o++){var u=q[o];var s=u.target;if(s){if(s instanceof Array){for(var n=0,t=s.length;n<t;n++){K[s[n]]=u}}else{K[typeof s=="string"?s:Ext.id(s)]=u}}}},unregister:function(l){delete K[Ext.id(l)]},enable:function(){if(J&&L){C.pop();if(C.length<1){L=false}}},disable:function(){L=true;clearTimeout(G);clearTimeout(F);clearTimeout(D);if(g){e(true)}C.push(1)},isEnabled:function(){return !L},tagConfig:{namespace:"ext",attribute:"qtip",width:"width",target:"target",title:"qtitle",hide:"hide",cls:"qclass"}}}();Ext.QuickTips.tips=Ext.QuickTips.register;Ext.tree.TreePanel=function(A,B){Ext.apply(this,B);Ext.tree.TreePanel.superclass.constructor.call(this);this.el=Ext.get(A);this.el.addClass("x-tree");this.id=this.el.id;this.addEvents({"beforeload":true,"load":true,"textchange":true,"beforeexpand":true,"beforecollapse":true,"expand":true,"disabledchange":true,"collapse":true,"beforeclick":true,"checkchange":true,"click":true,"dblclick":true,"contextmenu":true,"beforechildrenrendered":true,"startdrag":true,"enddrag":true,"dragdrop":true,"beforenodedrop":true,"nodedrop":true,"nodedragover":true});if(this.singleExpand){this.on("beforeexpand",this.restrictExpand,this)}};Ext.extend(Ext.tree.TreePanel,Ext.data.Tree,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,restrictExpand:function(A){var B=A.parentNode;if(B){if(B.expandedChild&&B.expandedChild.parentNode==B){B.expandedChild.collapse()}B.expandedChild=A}},setRootNode:function(A){Ext.tree.TreePanel.superclass.setRootNode.call(this,A);if(!this.rootVisible){A.ui=new Ext.tree.RootTreeNodeUI(A)}return A},getEl:function(){return this.el},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},getChecked:function(A,B){B=B||this.root;var C=[];var D=function(){if(this.attributes.checked){C.push(!A?this:(A=="id"?this.id:this.attributes[A]))}};B.cascade(D);return C},expandPath:function(E,D,C){D=D||"id";var B=E.split(this.pathSeparator);var A=this.root;if(A.attributes[D]!=B[1]){if(C){C(false,null)}return }var G=1;var F=function(){if(++G==B.length){if(C){C(true,A)}return }var H=A.findChild(D,B[G]);if(!H){if(C){C(false,A)}return }A=H;H.expand(false,false,F)};A.expand(false,false,F)},selectPath:function(F,E,C){E=E||"id";var B=F.split(this.pathSeparator);var A=B.pop();if(B.length>0){var D=function(H,G){if(H&&G){var I=G.findChild(E,A);if(I){I.select();if(C){C(true,I)}}else{if(C){C(false,I)}}}else{if(C){C(false,I)}}};this.expandPath(B.join(this.pathSeparator),E,D)}else{this.root.select();if(C){C(true,this.root)}}},getTreeEl:function(){return this.el},render:function(){this.innerCt=this.el.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.lines?"x-tree-lines":"x-tree-no-lines")});if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this);this.root.render();if(!this.rootVisible){this.root.renderChildren()}return this}});Ext.tree.DefaultSelectionModel=function(){this.selNode=null;this.addEvents({"selectionchange":true,"beforeselect":true})};Ext.extend(Ext.tree.DefaultSelectionModel,Ext.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this)},onNodeClick:function(A,B){this.select(A)},select:function(B){var A=this.selNode;if(A!=B&&this.fireEvent("beforeselect",this,B,A)!==false){if(A){A.ui.onSelectedChange(false)}this.selNode=B;B.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,B,A)}return B},unselect:function(A){if(this.selNode==A){this.clearSelections()}},clearSelections:function(){var A=this.selNode;if(A){A.ui.onSelectedChange(false);this.selNode=null;this.fireEvent("selectionchange",this,null)}return A},getSelectedNode:function(){return this.selNode},isSelected:function(A){return this.selNode==A},selectPrevious:function(){var A=this.selNode||this.lastSelNode;if(!A){return null}var C=A.previousSibling;if(C){if(!C.isExpanded()||C.childNodes.length<1){return this.select(C)}else{var B=C.lastChild;while(B&&B.isExpanded()&&B.childNodes.length>0){B=B.lastChild}return this.select(B)}}else{if(A.parentNode&&(this.tree.rootVisible||!A.parentNode.isRoot)){return this.select(A.parentNode)}}return null},selectNext:function(){var B=this.selNode||this.lastSelNode;if(!B){return null}if(B.firstChild&&B.isExpanded()){return this.select(B.firstChild)}else{if(B.nextSibling){return this.select(B.nextSibling)}else{if(B.parentNode){var A=null;B.parentNode.bubble(function(){if(this.nextSibling){A=this.getOwnerTree().selModel.select(this.nextSibling);return false}});return A}}}return null},onKeyDown:function(C){var B=this.selNode||this.lastSelNode;var D=this;if(!B){return }var A=C.getKey();switch(A){case C.DOWN:C.stopEvent();this.selectNext();break;case C.UP:C.stopEvent();this.selectPrevious();break;case C.RIGHT:C.preventDefault();if(B.hasChildNodes()){if(!B.isExpanded()){B.expand()}else{if(B.firstChild){this.select(B.firstChild,C)}}}break;case C.LEFT:C.preventDefault();if(B.hasChildNodes()&&B.isExpanded()){B.collapse()}else{if(B.parentNode&&(this.tree.rootVisible||B.parentNode!=this.tree.getRootNode())){this.select(B.parentNode,C)}}break}}});Ext.tree.MultiSelectionModel=function(){this.selNodes=[];this.selMap={};this.addEvents({"selectionchange":true})};Ext.extend(Ext.tree.MultiSelectionModel,Ext.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this)},onNodeClick:function(A,B){this.select(A,B,B.ctrlKey)},select:function(B,C,A){if(A!==true){this.clearSelections(true)}if(this.isSelected(B)){this.lastSelNode=B;return B}this.selNodes.push(B);this.selMap[B.id]=B;this.lastSelNode=B;B.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return B},unselect:function(B){if(this.selMap[B.id]){B.ui.onSelectedChange(false);var E=this.selNodes;var D=-1;if(E.indexOf){D=E.indexOf(B)}else{for(var C=0,A=E.length;C<A;C++){if(E[C]==B){D=C;break}}}if(D!=-1){this.selNodes.splice(D,1)}delete this.selMap[B.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(B){var D=this.selNodes;if(D.length>0){for(var C=0,A=D.length;C<A;C++){D[C].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(B!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(A){return this.selMap[A.id]?true:false},getSelectedNodes:function(){return this.selNodes},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.tree.TreeNode=function(B){B=B||{};if(typeof B=="string"){B={text:B}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,B);this.expanded=B.expanded===true;this.isTarget=B.isTarget!==false;this.draggable=B.draggable!==false&&B.allowDrag!==false;this.allowChildren=B.allowChildren!==false&&B.allowDrop!==false;this.text=B.text;this.disabled=B.disabled===true;this.addEvents({"textchange":true,"beforeexpand":true,"beforecollapse":true,"expand":true,"disabledchange":true,"collapse":true,"beforeclick":true,"checkchange":true,"click":true,"dblclick":true,"contextmenu":true,"beforechildrenrendered":true});var A=this.attributes.uiProvider||Ext.tree.TreeNodeUI;this.ui=new A(this)};Ext.extend(Ext.tree.TreeNode,Ext.data.Node,{preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},setFirstChild:function(A){var B=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,A);if(this.childrenRendered&&B&&A!=B){B.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(B){var A=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,B);if(this.childrenRendered&&A&&B!=A){A.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(){var A=Ext.tree.TreeNode.superclass.appendChild.apply(this,arguments);if(A&&this.childrenRendered){A.render()}this.ui.updateExpandIcon();return A},removeChild:function(A){this.ownerTree.getSelectionModel().unselect(A);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(this.childrenRendered){A.ui.remove()}if(this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}return A},insertBefore:function(A,C){var B=Ext.tree.TreeNode.superclass.insertBefore.apply(this,arguments);if(B&&C&&this.childrenRendered){A.render()}this.ui.updateExpandIcon();return B},setText:function(B){var A=this.text;this.text=B;this.attributes.text=B;if(this.rendered){this.ui.onTextChange(this,B,A)}this.fireEvent("textchange",this,B,A)},select:function(){this.getOwnerTree().getSelectionModel().select(this)},unselect:function(){this.getOwnerTree().getSelectionModel().unselect(this)},isSelected:function(){return this.getOwnerTree().getSelectionModel().isSelected(this)},expand:function(A,C,B){if(!this.expanded){if(this.fireEvent("beforeexpand",this,A,C)===false){return }if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&C!==false)||C){this.ui.animExpand(function(){this.fireEvent("expand",this);if(typeof B=="function"){B(this)}if(A===true){this.expandChildNodes(true)}}.createDelegate(this));return }else{this.ui.expand();this.fireEvent("expand",this);if(typeof B=="function"){B(this)}}}else{if(typeof B=="function"){B(this)}}if(A===true){this.expandChildNodes(true)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(E,D){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,E,D)===false){return }this.expanded=false;if((this.getOwnerTree().animate&&D!==false)||D){this.ui.animCollapse(function(){this.fireEvent("collapse",this);if(E===true){this.collapseChildNodes(true)}}.createDelegate(this));return }else{this.ui.collapse();this.fireEvent("collapse",this)}}if(E===true){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){C[B].collapse(true,false)}}},delayedExpand:function(A){if(!this.expandProcId){this.expandProcId=this.expand.defer(A,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(B){var A=this.getOwnerTree();A.expandPath(this.parentNode.getPath(),false,function(){A.getTreeEl().scrollChildIntoView(this.ui.anchor);Ext.callback(B)}.createDelegate(this))},expandChildNodes:function(B){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].expand(B)}},collapseChildNodes:function(B){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].collapse(B)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(B){if(B!==false){this.fireEvent("beforechildrenrendered",this)}var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].render(true)}this.childrenRendered=true},sort:function(D,E){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){C[B].render(true)}}},render:function(A){this.ui.render(A);if(!this.rendered){this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(E,D){if(D){this.ui.childIndent=null}this.ui.renderIndent();if(E===true&&this.childrenRendered){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){C[B].renderIndent(true,D)}}}});Ext.tree.AsyncTreeNode=function(A){this.loaded=false;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents({"beforeload":true,"load":true})};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(F,D,C){if(this.loading){var B;var E=function(){if(!this.loading){clearInterval(B);this.expand(F,D,C)}}.createDelegate(this);B=setInterval(E,200);return }if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return }this.loading=true;this.ui.beforeLoad(this);var A=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(A){A.load(this,this.loadComplete.createDelegate(this,[F,D,C]));return }}Ext.tree.AsyncTreeNode.superclass.expand.call(this,F,D,C)},isLoading:function(){return this.loading},loadComplete:function(B,A,C){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(B,A,C)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(A){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild)}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,A)}});Ext.tree.TreeNodeUI=function(A){this.node=A;this.rendered=false;this.animating=false;this.emptyIcon=Ext.BLANK_IMAGE_URL};Ext.tree.TreeNodeUI.prototype={removeChild:function(A){if(this.rendered){this.ctNode.removeChild(A.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(C,B,A){if(this.rendered){this.textNode.innerHTML=B}},onDisableChange:function(B,A){this.disabled=A;if(A){this.addClass("x-tree-node-disabled")}else{this.removeClass("x-tree-node-disabled")}},onSelectedChange:function(A){if(A){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(B,F,E,D,C,A){this.childIndent=null;if(this.rendered){var H=D.ui.getContainer();if(!H){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return }var G=A?A.ui.getEl():null;if(G){H.insertBefore(this.wrap,G)}else{H.appendChild(this.wrap)}this.node.renderIndent(true)}},addClass:function(A){if(this.elNode){Ext.fly(this.elNode).addClass(A)}},removeClass:function(A){if(this.elNode){Ext.fly(this.elNode).removeClass(A)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);var G=Ext.EventManager;var B=this.anchor;var D=Ext.fly(B,"_treeui");if(Ext.isOpera){D.setStyle("text-decoration","none")}D.on("click",this.onClick,this);D.on("dblclick",this.onDblClick,this);if(this.checkbox){Ext.EventManager.on(this.checkbox,"change",this.onCheckChange,this)}D.on("contextmenu",this.onContextMenu,this);var C=Ext.fly(this.iconNode);C.on("click",this.onClick,this);C.on("dblclick",this.onDblClick,this);C.on("contextmenu",this.onContextMenu,this);G.on(this.ecNode,"click",this.ecClick,this,true);if(this.node.disabled){this.addClass("x-tree-node-disabled")}if(this.node.hidden){this.addClass("x-tree-node-disabled")}var F=this.node.getOwnerTree();var A=F.enableDD||F.enableDrag||F.enableDrop;if(A&&(!this.node.isRoot||F.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode]},hide:function(){if(this.rendered){this.wrap.style.display="none"}},show:function(){if(this.rendered){this.wrap.style.display=""}},onContextMenu:function(A){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){A.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,A)}},onClick:function(A){if(this.dropping){A.stopEvent();return }if(this.fireEvent("beforeclick",this.node,A)!==false){if(!this.disabled&&this.node.attributes.href){this.fireEvent("click",this.node,A);return }A.preventDefault();if(this.disabled){return }if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.hasChildNodes()){this.node.toggle()}this.fireEvent("click",this.node,A)}else{A.stopEvent()}},onDblClick:function(A){A.preventDefault();if(this.disabled){return }if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.hasChildNodes()){this.node.toggle()}this.fireEvent("dblclick",this.node,A)},onCheckChange:function(){var A=this.checkbox.checked;this.node.attributes.checked=A;this.fireEvent("checkchange",this.node,A)},ecClick:function(A){if(!this.animating&&this.node.hasChildNodes()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(C){}}else{if(!Ext.isIE){try{var B=this.node.getOwnerTree().getTreeEl().dom;var A=B.scrollLeft;this.anchor.focus();B.scrollLeft=A}catch(C){}}}},toggleCheck:function(B){var A=this.checkbox;if(A){A.checked=(B===undefined?!A.checked:B)}},blur:function(){try{this.anchor.blur()}catch(A){}},animExpand:function(B){var A=Ext.get(this.ctNode);A.stopFx();if(!this.node.hasChildNodes()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(B);return }this.animating=true;this.updateExpandIcon();A.slideIn("t",{callback:function(){this.animating=false;Ext.callback(B)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var A=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(A.hlColor||"C3DAF9",{endColor:A.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(B){var A=Ext.get(this.ctNode);A.enableDisplayMode("block");A.stopFx();this.animating=true;this.updateExpandIcon();A.slideOut("t",{callback:function(){this.animating=false;Ext.callback(B)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(A){A.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(B){var D=this.node,A=D.attributes;var C=D.parentNode?D.parentNode.ui.getContainer():D.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(D,A,C,B);if(A.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",A.qtip);if(A.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",A.qtipTitle)}}else{this.textNode.setAttribute("ext:qtip",A.qtip);if(A.qtipTitle){this.textNode.setAttribute("ext:qtitle",A.qtipTitle)}}}else{if(A.qtipCfg){A.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(A.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon()}}else{if(B===true){C.appendChild(this.wrap)}}},renderElements:function(H,C,F,D){this.indentMarkup=H.parentNode?H.parentNode.ui.getChildIndent():"";var B=typeof C.checked=="boolean";var E=['<li class="x-tree-node"><div class="x-tree-node-el ',C.cls,'">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon" />','<img src="',C.icon||this.emptyIcon,'" class="x-tree-node-icon',(C.icon?" x-tree-node-inline-icon":""),(C.iconCls?" "+C.iconCls:""),'" unselectable="on" />',B?('<input class="x-tree-node-cb" type="checkbox" '+(C.checked?'checked="checked" />':" />")):"",'<a hidefocus="on" href="',C.href?C.href:"#",'" tabIndex="1" ',C.hrefTarget?' target="'+C.hrefTarget+'"':"",'><span unselectable="on">',H.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"];if(D!==true&&H.nextSibling&&H.nextSibling.ui.getEl()){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",H.nextSibling.ui.getEl(),E.join(""))}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",F,E.join(""))}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var G=this.elNode.childNodes;this.indentNode=G[0];this.ecNode=G[1];this.iconNode=G[2];var A=3;if(B){this.checkbox=G[3];A++}this.anchor=G[A];this.textNode=G[A].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var F=this.node,D,C;var A=F.isLast()?"x-tree-elbow-end":"x-tree-elbow";var E=F.hasChildNodes();if(E){if(F.expanded){A+="-minus";D="x-tree-node-collapsed";C="x-tree-node-expanded"}else{A+="-plus";D="x-tree-node-expanded";C="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=D||this.c2!=C){Ext.fly(this.elNode).replaceClass(D,C);this.c1=D;this.c2=C}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true}}var B="x-tree-ec-icon "+A;if(this.ecc!=B){this.ecNode.className=B;this.ecc=B}}},getChildIndent:function(){if(!this.childIndent){var A=[];var B=this.node;while(B){if(!B.isRoot||(B.isRoot&&B.ownerTree.rootVisible)){if(!B.isLast()){A.unshift('<img src="'+this.emptyIcon+'" class="x-tree-elbow-line">')}else{A.unshift('<img src="'+this.emptyIcon+'" class="x-tree-icon">')}}B=B.parentNode}this.childIndent=A.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var A="";var B=this.node.parentNode;if(B){A=B.ui.getChildIndent()}if(this.indentMarkup!=A){this.indentNode.innerHTML=A;this.indentMarkup=A}this.updateExpandIcon()}}};Ext.tree.RootTreeNodeUI=function(){Ext.tree.RootTreeNodeUI.superclass.constructor.apply(this,arguments)};Ext.extend(Ext.tree.RootTreeNodeUI,Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var A=this.node.ownerTree.innerCt.dom;this.node.expanded=true;A.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=A.firstChild}},collapse:function(){},expand:function(){}});Ext.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Ext.apply(this,A);this.addEvents({"beforeload":true,"load":true,"loadexception":true});Ext.tree.TreeLoader.superclass.constructor.call(this)};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,load:function(E,D){if(this.clearOnLoad){while(E.firstChild){E.removeChild(E.firstChild)}}if(E.attributes.children){var C=E.attributes.children;for(var B=0,A=C.length;B<A;B++){E.appendChild(this.createNode(C[B]))}if(typeof D=="function"){D()}}else{if(this.dataUrl){this.requestData(E,D)}}},getParams:function(B){var A=[],D=this.baseParams;for(var C in D){if(typeof D[C]!="function"){A.push(encodeURIComponent(C),"=",encodeURIComponent(D[C]),"&")}}A.push("node=",encodeURIComponent(B.id));return A.join("")},requestData:function(B,A){if(this.fireEvent("beforeload",this,B,A)!==false){this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:A,node:B},params:this.getParams(B)})}else{if(typeof A=="function"){A()}}},isLoading:function(){return this.transId?true:false},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(_d){if(this.baseAttrs){Ext.applyIf(_d,this.baseAttrs)}if(this.applyLoader!==false){_d.loader=this}if(typeof _d.uiProvider=="string"){_d.uiProvider=this.uiProviders[_d.uiProvider]||eval(_d.uiProvider)}return(_d.leaf?new Ext.tree.TreeNode(_d):new Ext.tree.AsyncTreeNode(_d))},processResponse:function(_e,_f,_10){var _11=_e.responseText;try{var o=eval("("+_11+")");for(var i=0,len=o.length;i<len;i++){var n=this.createNode(o[i]);if(n){_f.appendChild(n)}}if(typeof _10=="function"){_10(this,_f)}}catch(e){this.handleFailure(_e)}},handleResponse:function(B){this.transId=false;var A=B.argument;this.processResponse(B,A.node,A.callback);this.fireEvent("load",this,A.node,B)},handleFailure:function(B){this.transId=false;var A=B.argument;this.fireEvent("loadexception",this,A.node,B);if(typeof A.callback=="function"){A.callback(this,A.node)}}});Ext.tree.TreeFilter=function(B,A){this.tree=B;this.filtered={};Ext.apply(this,A)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(D,C,B){C=C||"text";var E;if(typeof D=="string"){var A=D.length;if(A==0&&this.clearBlank){this.clear();return }D=D.toLowerCase();E=function(F){return F.attributes[C].substr(0,A).toLowerCase()==D}}else{if(D.exec){E=function(F){return D.test(F.attributes[C])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(E,null,B)},filterBy:function(D,C,A){A=A||this.tree.root;if(this.autoClear){this.clear()}var B=this.filtered,H=this.reverse;var E=function(J){if(J==A){return true}if(B[J.id]){return false}var I=D.call(C||J,J);if(!I||H){B[J.id]=J;J.ui.hide();return false}return true};A.cascade(E);if(this.remove){for(var G in B){if(typeof G!="function"){var F=B[G];if(F&&F.parentNode){F.parentNode.removeChild(F)}}}}},clear:function(){var B=this.tree;var A=this.filtered;for(var D in A){if(typeof D!="function"){var C=A[D];if(C){C.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=function(H,F){Ext.apply(this,F);H.on("beforechildrenrendered",this.doSort,this);H.on("append",this.updateSort,this);H.on("insert",this.updateSort,this);var E=this.dir&&this.dir.toLowerCase()=="desc";var G=this.property||"text";var C=this.sortType;var A=this.folderSort;var D=this.caseSensitive===true;var B=this.leafAttr||"leaf";this.sortFn=function(J,I){if(A){if(J.attributes[B]&&!I.attributes[B]){return 1}if(!J.attributes[B]&&I.attributes[B]){return -1}}var L=C?C(J):(D?J.attributes[G]:J.attributes[G].toUpperCase());var K=C?C(I):(D?I.attributes[G]:I.attributes[G].toUpperCase());if(L<K){return E?+1:-1}else{if(L>K){return E?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(A){A.sort(this.sortFn)},compareNodes:function(B,A){return(B.text.toUpperCase()>A.text.toUpperCase()?1:-1)},updateSort:function(B,A){if(A.childrenRendered){this.doSort.defer(1,this,[A])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(B,A){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Ext.tree.TreeDropZone.superclass.constructor.call(this,B.innerCt,A);this.tree=B;this.lastInsertClass="x-tree-no-status";this.dragOverData={}};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(A){if(A.hasChildNodes()&&!A.isExpanded()){A.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(A){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[A])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(A,I,H,D,B){if(!A||!B){return false}var G=A.node;var F=B.node;if(!(G&&G.isTarget&&I)){return false}if(I=="append"&&G.allowChildren===false){return false}if((I=="above"||I=="below")&&(G.parentNode&&G.parentNode.allowChildren===false)){return false}if(F&&(G==F||F.contains(G))){return false}var E=this.dragOverData;E.tree=this.tree;E.target=G;E.data=B;E.point=I;E.source=H;E.rawEvent=D;E.dropNode=F;E.cancel=false;var C=this.tree.fireEvent("nodedragover",E);return E.cancel===false&&C!==false},getDropPoint:function(F,C,I){var J=C.node;if(J.isRoot){return J.allowChildren!==false?"append":false}var E=C.ddel;var K=Ext.lib.Dom.getY(E),H=K+E.offsetHeight;var G=Ext.lib.Event.getPageY(F);var D=J.allowChildren===false||J.isLeaf();if(this.appendOnly||J.parentNode.allowChildren===false){return D?false:"append"}var B=false;if(!this.allowParentInsert){B=J.hasChildNodes()&&J.isExpanded()}var A=(H-K)/(D?2:3);if(G>=K&&G<(K+A)){return"above"}else{if(!B&&(D||G>=H-A&&G<=H)){return"below"}else{return"append"}}},onNodeEnter:function(D,A,C,B){this.cancelExpand()},onNodeOver:function(E,G,F,D){var I=this.getDropPoint(F,E,G);var B=E.node;if(!this.expandProcId&&I=="append"&&B.hasChildNodes()&&!E.node.isExpanded()){this.queueExpand(B)}else{if(I!="append"){this.cancelExpand()}}var A=this.dropNotAllowed;if(this.isValidDropPoint(E,I,G,F,D)){if(I){var C=E.ddel;var H;if(I=="above"){A=E.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";H="x-tree-drag-insert-above"}else{if(I=="below"){A=E.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";H="x-tree-drag-insert-below"}else{A="x-tree-drop-ok-append";H="x-tree-drag-append"}}if(this.lastInsertClass!=H){Ext.fly(C).replaceClass(this.lastInsertClass,H);this.lastInsertClass=H}}}return A},onNodeOut:function(D,A,C,B){this.cancelExpand();this.removeDropIndicators(D)},onNodeDrop:function(A,H,B,I){var G=this.getDropPoint(B,A,H);var F=A.node;F.ui.startDrop();if(!this.isValidDropPoint(A,G,H,B,I)){F.ui.endDrop();return false}var E=I.node||(H.getTreeNode?H.getTreeNode(I,F,G,B):null);var D={tree:this.tree,target:F,data:I,point:G,source:H,rawEvent:B,dropNode:E,cancel:!E};var C=this.tree.fireEvent("beforenodedrop",D);if(C===false||D.cancel===true||!D.dropNode){F.ui.endDrop();return false}F=D.target;if(G=="append"&&!F.isExpanded()){F.expand(false,null,function(){this.completeDrop(D)}.createDelegate(this))}else{this.completeDrop(D)}return true},completeDrop:function(G){var D=G.dropNode,E=G.point,C=G.target;if(!(D instanceof Array)){D=[D]}var F;for(var B=0,A=D.length;B<A;B++){F=D[B];if(E=="above"){C.parentNode.insertBefore(F,C)}else{if(E=="below"){C.parentNode.insertBefore(F,C.nextSibling)}else{C.appendChild(F)}}}F.ui.focus();if(this.tree.hlDrop){F.ui.highlight()}C.ui.endDrop();this.tree.fireEvent("nodedrop",G)},afterNodeMoved:function(A,E,D,C,B){if(this.tree.hlDrop){B.ui.focus();B.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,C,E,A,D)},getTree:function(){return this.tree},removeDropIndicators:function(B){if(B&&B.ddel){var A=B.ddel;Ext.fly(A).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(A,B,C){this.cancelExpand();return true},afterRepair:function(A){if(A&&Ext.enableFx){A.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(B,A){Ext.tree.TreeDragZone.superclass.constructor.call(this,B.getTreeEl(),A);this.tree=B};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(A,B){var C=A.node;return C&&C.draggable&&!C.disabled},onInitDrag:function(B){var A=this.dragData;this.tree.getSelectionModel().select(A.node);this.proxy.update("");A.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,A.node,B)},getRepairXY:function(B,A){return A.node.ui.getDDRepairXY()},onEndDrag:function(A,B){this.tree.fireEvent("enddrag",this.tree,A.node,B)},onValidDrop:function(A,B,C){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,A,B);this.hideProxy()},beforeInvalidDrop:function(A,C){var B=this.tree.getSelectionModel();B.clearSelections();B.select(this.dragData.node)}})}Ext.tree.TreeEditor=function(C,B){B=B||{};var A=B.events?B:new Ext.form.TextField(B);Ext.tree.TreeEditor.superclass.constructor.call(this,A);this.tree=C;C.on("beforeclick",this.beforeNodeClick,this);C.getTreeEl().on("mousedown",this.hide,this);this.on("complete",this.updateNode,this);this.on("beforestartedit",this.fitToTree,this);this.on("startedit",this.bindScroll,this,{delay:10});this.on("specialkey",this.onSpecialKey,this)};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,fitToTree:function(B,C){var E=this.tree.getTreeEl().dom,D=C.dom;if(E.scrollLeft>D.offsetLeft){E.scrollLeft=D.offsetLeft}var A=Math.min(this.maxWidth,(E.clientWidth>20?E.clientWidth:E.offsetWidth)-Math.max(0,D.offsetLeft-E.scrollLeft)-5);this.setSize(A,"")},triggerEdit:function(A){this.completeEdit();this.editNode=A;this.startEdit(A.ui.textNode,A.text)},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(B,C){var A=(this.lastClick?this.lastClick.getElapsed():0);this.lastClick=new Date();if(A>this.editDelay&&this.tree.getSelectionModel().isSelected(B)){C.stopEvent();this.triggerEdit(B);return false}},updateNode:function(B,A){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(A)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus()}},onSpecialKey:function(C,B){var A=B.getKey();if(A==B.ESC){B.stopEvent();this.cancelEdit()}else{if(A==B.ENTER&&!B.hasModifier()){B.stopEvent();this.completeEdit()}}}});Ext.menu.Menu=function(B){Ext.apply(this,B);this.id=this.id||Ext.id();this.addEvents({beforeshow:true,beforehide:true,show:true,hide:true,click:true,mouseover:true,mouseout:true,itemclick:true});Ext.menu.MenuMgr.register(this);var A=this.items;this.items=new Ext.util.MixedCollection();if(A){this.add.apply(this,A)}};Ext.extend(Ext.menu.Menu,Ext.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,hidden:true,render:function(){if(this.el){return }var B=this.el=new Ext.Layer({cls:"x-menu",shadow:this.shadow,constrain:false,parentEl:this.parentEl||document.body,zindex:15000});this.keyNav=new Ext.menu.MenuNav(this);if(this.plain){B.addClass("x-menu-plain")}if(this.cls){B.addClass(this.cls)}this.focusEl=B.createChild({tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"});var A=B.createChild({tag:"ul",cls:"x-menu-list"});A.on("click",this.onClick,this);A.on("mouseover",this.onMouseOver,this);A.on("mouseout",this.onMouseOut,this);this.items.each(function(D){var C=document.createElement("li");C.className="x-menu-list-item";A.dom.appendChild(C);D.render(C,this)},this);this.ul=A;this.autoWidth()},autoWidth:function(){var D=this.el,C=this.ul;if(!D){return }var A=this.width;if(A){D.setWidth(A)}else{if(Ext.isIE){D.setWidth(this.minWidth);var B=D.dom.offsetWidth;D.setWidth(C.getWidth()+D.getFrameWidth("lr"))}}},delayAutoWidth:function(){if(this.rendered){if(!this.awTask){this.awTask=new Ext.util.DelayedTask(this.autoWidth,this)}this.awTask.delay(20)}},findTargetItem:function(B){var A=B.getTarget(".x-menu-list-item",this.ul,true);if(A&&A.menuItemId){return this.items.get(A.menuItemId)}},onClick:function(B){var A;if(A=this.findTargetItem(B)){A.onClick(B);this.fireEvent("click",this,A,B)}},setActiveItem:function(B,A){if(B!=this.activeItem){if(this.activeItem){this.activeItem.deactivate()}this.activeItem=B;B.activate(A)}else{if(A){B.expandMenu()}}},tryActivate:function(F,E){var D=this.items;for(var C=F,A=D.length;C>=0&&C<A;C+=E){var B=D.get(C);if(!B.disabled&&B.canActivate){this.setActiveItem(B,false);return B}}return false},onMouseOver:function(B){var A;if(A=this.findTargetItem(B)){if(A.canActivate&&!A.disabled){this.setActiveItem(A,true)}}this.fireEvent("mouseover",this,B,A)},onMouseOut:function(B){var A;if(A=this.findTargetItem(B)){if(A==this.activeItem&&A.shouldDeactivate(B)){this.activeItem.deactivate();delete this.activeItem}}this.fireEvent("mouseout",this,B,A)},isVisible:function(){return this.el&&!this.hidden},show:function(B,C,A){this.parentMenu=A;if(!this.el){this.render()}this.fireEvent("beforeshow",this);this.showAt(this.el.getAlignToXY(B,C||this.defaultAlign),A,false)},showAt:function(C,B,A){this.parentMenu=B;if(!this.el){this.render()}if(A!==false){this.fireEvent("beforeshow",this);C=this.el.adjustForConstraints(C)}this.el.setXY(C);this.el.show();this.hidden=false;this.focus();this.fireEvent("show",this)},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(A){if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);if(this.activeItem){this.activeItem.deactivate();this.activeItem=null}this.el.hide();this.hidden=true;this.fireEvent("hide",this)}if(A===true&&this.parentMenu){this.parentMenu.hide(true)}},add:function(){var B=arguments,A=B.length,E;for(var C=0;C<A;C++){var D=B[C];if(D.render){E=this.addItem(D)}else{if(typeof D=="string"){if(D=="separator"||D=="-"){E=this.addSeparator()}else{E=this.addText(D)}}else{if(D.tagName||D.el){E=this.addElement(D)}else{if(typeof D=="object"){E=this.addMenuItem(D)}}}}}return E},getEl:function(){if(!this.el){this.render()}return this.el},addSeparator:function(){return this.addItem(new Ext.menu.Separator())},addElement:function(A){return this.addItem(new Ext.menu.BaseItem(A))},addItem:function(B){this.items.add(B);if(this.ul){var A=document.createElement("li");A.className="x-menu-list-item";this.ul.dom.appendChild(A);B.render(A,this);this.delayAutoWidth()}return B},addMenuItem:function(A){if(!(A instanceof Ext.menu.Item)){if(typeof A.checked=="boolean"){A=new Ext.menu.CheckItem(A)}else{A=new Ext.menu.Item(A)}}return this.addItem(A)},addText:function(A){return this.addItem(new Ext.menu.TextItem(A))},insert:function(C,B){this.items.insert(C,B);if(this.ul){var A=document.createElement("li");A.className="x-menu-list-item";this.ul.dom.insertBefore(A,this.ul.dom.childNodes[C]);B.render(A,this);this.delayAutoWidth()}return B},remove:function(A){this.items.removeKey(A.id);A.destroy()},removeAll:function(){var A;while(A=this.items.first()){this.remove(A)}}});Ext.menu.MenuNav=function(A){Ext.menu.MenuNav.superclass.constructor.call(this,A.el);this.scope=this.menu=A};Ext.extend(Ext.menu.MenuNav,Ext.KeyNav,{doRelay:function(C,B){var A=C.getKey();if(!this.menu.activeItem&&C.isNavKeyPress()&&A!=C.SPACE&&A!=C.RETURN){this.menu.tryActivate(0,1);return false}return B.call(this.scope||this,C,this.menu)},up:function(B,A){if(!A.tryActivate(A.items.indexOf(A.activeItem)-1,-1)){A.tryActivate(A.items.length-1,-1)}},down:function(B,A){if(!A.tryActivate(A.items.indexOf(A.activeItem)+1,1)){A.tryActivate(0,1)}},right:function(B,A){if(A.activeItem){A.activeItem.expandMenu(true)}},left:function(B,A){A.hide();if(A.parentMenu&&A.parentMenu.activeItem){A.parentMenu.activeItem.activate()}},enter:function(B,A){if(A.activeItem){B.stopPropagation();A.activeItem.onClick(B);A.fireEvent("click",this,A.activeItem);return true}}});Ext.menu.MenuMgr=function(){var L,K,I={},H=false,G=new Date();function M(){L={},K=new Ext.util.MixedCollection();Ext.get(document).addKeyListener(27,function(){if(K.length>0){D()}})}function D(){if(K.length>0){var N=K.clone();N.each(function(O){O.hide()})}}function B(N){K.remove(N);if(K.length<1){Ext.get(document).un("mousedown",J);H=false}}function F(N){var O=K.last();G=new Date();K.add(N);if(!H){Ext.get(document).on("mousedown",J);H=true}if(N.parentMenu){N.getEl().setZIndex(parseInt(N.parentMenu.getEl().getStyle("z-index"),10)+3);N.parentMenu.activeChild=N}else{if(O&&O.isVisible()){N.getEl().setZIndex(parseInt(O.getEl().getStyle("z-index"),10)+3)}}}function A(N){if(N.activeChild){N.activeChild.hide()}if(N.autoHideTimer){clearTimeout(N.autoHideTimer);delete N.autoHideTimer}}function C(N){var O=N.parentMenu;if(!O&&!N.allowOtherMenus){D()}else{if(O&&O.activeChild){O.activeChild.hide()}}}function J(N){if(G.getElapsed()>50&&K.length>0&&!N.getTarget(".x-menu")){D()}}function E(O,R){if(R){var Q=I[O.group];for(var P=0,N=Q.length;P<N;P++){if(Q[P]!=O){Q[P].setChecked(false)}}}}return{hideAll:function(){D()},register:function(O){if(!L){M()}L[O.id]=O;O.on("beforehide",A);O.on("hide",B);O.on("beforeshow",C);O.on("show",F);var N=O.group;if(N&&O.events["checkchange"]){if(!I[N]){I[N]=[]}I[N].push(O);O.on("checkchange",onCheck)}},get:function(N){if(typeof N=="string"){return L[N]}else{if(N.events){return N}else{if(typeof N.length=="number"){return new Ext.menu.Menu({items:N})}else{return new Ext.menu.Menu(N)}}}},unregister:function(N){delete L[N.id];N.un("beforehide",A);N.un("hide",B);N.un("beforeshow",C);N.un("show",F);var O=N.group;if(O&&N.events["checkchange"]){I[O].remove(N);N.un("checkchange",onCheck)}},registerCheckable:function(N){var O=N.group;if(O){if(!I[O]){I[O]=[]}I[O].push(N);N.on("beforecheckchange",E)}},unregisterCheckable:function(N){var O=N.group;if(O){I[O].remove(N);N.un("beforecheckchange",E)}}}}();Ext.menu.BaseItem=function(A){Ext.menu.BaseItem.superclass.constructor.call(this,A);this.addEvents({click:true,activate:true,deactivate:true});if(this.handler){this.on("click",this.handler,this.scope,true)}};Ext.extend(Ext.menu.BaseItem,Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,hideDelay:100,ctype:"Ext.menu.BaseItem",actionMode:"container",render:function(B,A){this.parentMenu=A;Ext.menu.BaseItem.superclass.render.call(this,B);this.container.menuItemId=this.id},onRender:function(B,A){this.el=Ext.get(this.el);B.dom.appendChild(this.el.dom)},onClick:function(A){if(!this.disabled&&this.fireEvent("click",this,A)!==false&&this.parentMenu.fireEvent("itemclick",this,A)!==false){this.handleClick(A)}else{A.stopEvent()}},activate:function(){if(this.disabled){return false}var A=this.container;A.addClass(this.activeClass);this.region=A.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(A){return !this.region||!this.region.contains(A.getPoint())},handleClick:function(A){if(this.hideOnClick){this.parentMenu.hide.defer(this.hideDelay,this.parentMenu,[true])}},expandMenu:function(A){},hideMenu:function(){}});Ext.menu.TextItem=function(A){this.text=A;Ext.menu.TextItem.superclass.constructor.call(this)};Ext.extend(Ext.menu.TextItem,Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",onRender:function(){var A=document.createElement("span");A.className=this.itemCls;A.innerHTML=this.text;this.el=A;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.menu.Separator=function(A){Ext.menu.Separator.superclass.constructor.call(this,A)};Ext.extend(Ext.menu.Separator,Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,onRender:function(A){var B=document.createElement("span");B.className=this.itemCls;B.innerHTML="&#160;";this.el=B;A.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.menu.Item=function(A){Ext.menu.Item.superclass.constructor.call(this,A);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}};Ext.extend(Ext.menu.Item,Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,ctype:"Ext.menu.Item",showDelay:200,hideDelay:200,onRender:function(C,B){var A=document.createElement("a");A.hideFocus=true;A.unselectable="on";A.href=this.href||"#";if(this.hrefTarget){A.target=this.hrefTarget}A.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");A.innerHTML=String.format('<img src="{0}" class="x-menu-item-icon {2}" />{1}',this.icon||Ext.BLANK_IMAGE_URL,this.text,this.iconCls||"");this.el=A;Ext.menu.Item.superclass.onRender.call(this,C,B)},setText:function(A){this.text=A;if(this.rendered){this.el.update(String.format('<img src="{0}" class="x-menu-item-icon {2}">{1}',this.icon||Ext.BLANK_IMAGE_URL,this.text,this.iconCls||""));this.parentMenu.autoWidth()}},handleClick:function(A){if(!this.href){A.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(A){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(A){this.expandMenu()}}return true},shouldDeactivate:function(A){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,A)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(A.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(A){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[A])}else{if(this.menu.isVisible()&&A){this.menu.tryActivate(0,1)}}}},deferExpand:function(A){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(A){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;this.menu.hide()}});Ext.menu.CheckItem=function(A){Ext.menu.CheckItem.superclass.constructor.call(this,A);this.addEvents({"beforecheckchange":true,"checkchange":true});if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}};Ext.extend(Ext.menu.CheckItem,Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",onRender:function(A){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}Ext.menu.MenuMgr.registerCheckable(this);if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){if(this.rendered){Ext.menu.MenuMgr.unregisterCheckable(this)}Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(B,A){if(this.checked!=B&&this.fireEvent("beforecheckchange",this,B)!==false){if(this.container){this.container[B?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=B;if(A!==true){this.fireEvent("checkchange",this,B)}}},handleClick:function(A){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.menu.Adapter=function(B,A){Ext.menu.Adapter.superclass.constructor.call(this,A);this.component=B};Ext.extend(Ext.menu.Adapter,Ext.menu.BaseItem,{canActivate:true,onRender:function(B,A){this.component.render(B);this.el=this.component.getEl()},activate:function(){if(this.disabled){return false}this.component.focus();this.fireEvent("activate",this);return true},deactivate:function(){this.fireEvent("deactivate",this)},disable:function(){this.component.disable();Ext.menu.Adapter.superclass.disable.call(this)},enable:function(){this.component.enable();Ext.menu.Adapter.superclass.enable.call(this)}});Ext.menu.DateItem=function(A){Ext.menu.DateItem.superclass.constructor.call(this,new Ext.DatePicker(A),A);this.picker=this.component;this.addEvents({select:true});this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item")});this.picker.on("select",this.onSelect,this)};Ext.extend(Ext.menu.DateItem,Ext.menu.Adapter,{onSelect:function(B,A){this.fireEvent("select",this,A,B);Ext.menu.DateItem.superclass.handleClick.call(this)}});Ext.menu.ColorItem=function(A){Ext.menu.ColorItem.superclass.constructor.call(this,new Ext.ColorPalette(A),A);this.palette=this.component;this.relayEvents(this.palette,["select"]);if(this.selectHandler){this.on("select",this.selectHandler,this.scope)}};Ext.extend(Ext.menu.ColorItem,Ext.menu.Adapter);Ext.menu.DateMenu=function(B){Ext.menu.DateMenu.superclass.constructor.call(this,B);this.plain=true;var A=new Ext.menu.DateItem(B);this.add(A);this.picker=A.picker;this.relayEvents(A,["select"]);this.on("beforeshow",function(){if(this.picker){this.picker.hideMonthPicker(true)}},this)};Ext.extend(Ext.menu.DateMenu,Ext.menu.Menu,{cls:"x-date-menu"});Ext.menu.ColorMenu=function(B){Ext.menu.ColorMenu.superclass.constructor.call(this,B);this.plain=true;var A=new Ext.menu.ColorItem(B);this.add(A);this.palette=A.palette;this.relayEvents(A,["select"])};Ext.extend(Ext.menu.ColorMenu,Ext.menu.Menu);Ext.form.Field=function(A){Ext.form.Field.superclass.constructor.call(this,A)};Ext.extend(Ext.form.Field,Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true})},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||"")},onRender:function(B,D){Ext.form.Field.superclass.onRender.call(this,B,D);if(!this.el){var C=this.getAutoCreate();if(!C.name){C.name=this.name||this.id}if(this.inputType){C.type=this.inputType}this.el=B.createChild(C,D)}var A=this.el.dom.type;if(A){if(A=="password"){A="text"}this.el.addClass("x-form-"+A)}if(this.readOnly){this.el.dom.readOnly=true}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls]);this.initValue()},applyTo:function(A){this.allowDomMove=false;this.el=Ext.get(A);this.render(this.el.dom.parentNode);return this},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(this.el.dom.value.length>0){this.setValue(this.el.dom.value)}}},isDirty:function(){if(this.disabled){return false}return String(this.getValue())!==String(this.originalValue)},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents()},fireKey:function(A){if(A.isNavKeyPress()){this.fireEvent("specialkey",this,A)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.el.on(Ext.isIE?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.originalValue=this.getValue()},onFocus:function(){if(!Ext.isOpera){this.el.addClass(this.focusClass)}this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();this.el.removeClass(this.focusClass);this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate()}var A=this.getValue();if(A!=this.startValue){this.fireEvent("change",this,A,this.startValue)}this.fireEvent("blur",this)},isValid:function(A){if(this.disabled){return true}var C=this.preventMark;this.preventMark=A===true;var B=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=C;return B},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(A){return A},validateValue:function(A){return true},markInvalid:function(A){if(!this.rendered||this.preventMark){return }this.el.addClass(this.invalidClass);A=A||this.invalidText;switch(this.msgTarget){case"qtip":this.el.dom.qtip=A;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}break;case"title":this.el.dom.title=A;break;case"under":if(!this.errorEl){var C=this.el.findParent(".x-form-element",5,true);this.errorEl=C.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(C.getWidth(true)-20)}this.errorEl.update(A);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case"side":if(!this.errorIcon){var C=this.el.findParent(".x-form-element",5,true);this.errorIcon=C.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this);break;default:var B=Ext.getDom(this.msgTarget);B.innerHTML=A;B.style.display=this.msgDisplay;break}this.fireEvent("invalid",this,A)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},clearInvalid:function(){if(!this.rendered||this.preventMark){return }this.el.removeClass(this.invalidClass);switch(this.msgTarget){case"qtip":this.el.dom.qtip="";break;case"title":this.el.dom.title="";break;case"under":if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}break;case"side":if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}break;default:var A=Ext.getDom(this.msgTarget);A.innerHTML="";A.style.display="none";break}this.fireEvent("valid",this)},getRawValue:function(){var A=this.el.getValue();if(A===this.emptyText){A=""}return A},getValue:function(){var A=this.el.getValue();if(A===this.emptyText||A===undefined){A=""}return A},setRawValue:function(A){return this.el.dom.value=(A===null||A===undefined?"":A)},setValue:function(A){this.value=A;if(this.rendered){this.el.dom.value=(A===null||A===undefined?"":A);this.validate()}},adjustSize:function(A,C){var B=Ext.form.Field.superclass.adjustSize.call(this,A,C);B.width=this.adjustWidth(this.el.dom.tagName,B.width);return B},adjustWidth:function(A,B){A=A.toLowerCase();if(typeof B=="number"&&Ext.isStrict&&!Ext.isSafari){if(Ext.isIE&&(A=="input"||A=="textarea")){if(A=="input"){return B+2}if(A="textarea"){return B-2}}else{if(Ext.isOpera){if(A=="input"){return B+2}if(A="textarea"){return B-2}}}}return B}});Ext.form.Field.msgFx={normal:{show:function(A,B){A.setDisplayed("block")},hide:function(A,B){A.setDisplayed(false).update("")}},slide:{show:function(A,B){A.slideIn("t",{stopFx:true})},hide:function(A,B){A.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(B,A){B.fixDisplay();B.alignTo(A.el,"tl-tr");B.slideIn("l",{stopFx:true})},hide:function(B,A){B.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.form.TextField=function(A){Ext.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true})};Ext.extend(Ext.form.TextField,Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.el.on("keyup",this.filterValidation,this)}else{if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);if(this.emptyText){this.on("blur",this.postBlur,this);this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.el.on("keypress",this.filterKeys,this)}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50});this.el.on("click",this.autoSize,this)}},processValue:function(B){if(this.stripCharsRe){var A=B.replace(this.stripCharsRe,"");if(A!==B){this.setRawValue(A);return A}}return B},filterValidation:function(A){if(!A.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onKeyUp:function(A){if(!A.isNavKeyPress()){this.autoSize()}},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue("")}this.el.removeClass(this.emptyClass)}if(this.selectOnFocus){this.el.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(B){var A=B.getKey();if(!Ext.isIE&&(B.isNavKeyPress()||A==B.BACKSPACE||(A==B.DELETE&&B.button==-1))){return }if(Ext.isIE&&(A==B.BACKSPACE||A==B.DELETE||B.isNavKeyPress()||A==B.HOME||A==B.END)){return }var C=B.getCharCode();if(!this.maskRe.test(String.fromCharCode(C)||"")){B.stopEvent()}},setValue:function(A){if(this.emptyText&&this.el&&A!==undefined&&A!==null&&A!==""){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize()},validateValue:function(B){if(B.length<1||B===this.emptyText){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}if(B.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(B.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}if(this.vtype){var C=Ext.form.VTypes;if(!C[this.vtype](B,this)){this.markInvalid(this.vtypeText||C[this.vtype+"Text"]);return false}}if(typeof this.validator=="function"){var A=this.validator(B);if(A!==true){this.markInvalid(A);return false}}if(this.regex&&!this.regex.test(B)){this.markInvalid(this.regexText);return false}return true},selectText:function(B,A){var C=this.getRawValue();if(C.length>0){B=B===undefined?0:B;A=A===undefined?C.length:A;var E=this.el.dom;if(E.setSelectionRange){E.setSelectionRange(B,A)}else{if(E.createTextRange){var D=E.createTextRange();D.moveStart("character",B);D.moveEnd("character",C.length-A);D.select()}}}},autoSize:function(){if(!this.grow||!this.rendered){return }if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var C=this.el;var B=C.dom.value;var D=document.createElement("div");D.appendChild(document.createTextNode(B));B=D.innerHTML;D=null;B+="&#160;";var A=Math.min(this.growMax,Math.max(this.metrics.getWidth(B)+10,this.growMin));this.el.setWidth(A);this.fireEvent("autosize",this,A)}});Ext.form.TriggerField=function(A){this.mimicing=false;Ext.form.TriggerField.superclass.constructor.call(this,A)};Ext.extend(Ext.form.TriggerField,Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,onResize:function(A,B){Ext.form.TriggerField.superclass.onResize.apply(this,arguments);if(typeof A=="number"){this.el.setWidth(this.adjustWidth("input",A-this.trigger.getWidth()))}},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])},onRender:function(B,A){Ext.form.TriggerField.superclass.onRender.call(this,B,A);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false)}this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove()}if(this.wrap){this.wrap.remove()}Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this);if(this.monitorTab){this.el.on("keydown",this.checkTab,this)}}},checkTab:function(A){if(A.getKey()==A.TAB){this.triggerBlur()}},onBlur:function(){},mimicBlur:function(B,A){if(!this.wrap.contains(A)&&this.validateBlur()){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this)}this.wrap.removeClass("x-trigger-wrap-focus");Ext.form.TriggerField.superclass.onBlur.call(this)},validateBlur:function(B,A){return true},onDisable:function(){Ext.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass("x-item-disabled")}},onEnable:function(){Ext.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass("x-item-disabled")}},onShow:function(){if(this.wrap){this.wrap.dom.style.display="";this.wrap.dom.style.visibility="visible"}},onHide:function(){this.wrap.dom.style.display="none"},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(A){return this.triggers[A]},initTrigger:function(){var B=this.trigger.select(".x-form-trigger",true);this.wrap.setStyle("overflow","hidden");var A=this;B.each(function(C,F,E){C.hide=function(){var G=A.wrap.getWidth();this.dom.style.display="none";A.el.setWidth(G-A.trigger.getWidth())};C.show=function(){var G=A.wrap.getWidth();this.dom.style.display="";A.el.setWidth(G-A.trigger.getWidth())};var D="Trigger"+(E+1);if(this["hide"+D]){C.dom.style.display="none"}C.on("click",this["on"+D+"Click"],this,{preventDefault:true});C.addClassOnOver("x-form-trigger-over");C.addClassOnClick("x-form-trigger-click")},this);this.triggers=B.elements},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.form.TextArea=function(A){Ext.form.TextArea.superclass.constructor.call(this,A);if(this.minHeight!==undefined){this.growMin=this.minHeight}if(this.maxHeight!==undefined){this.growMax=this.maxHeight}};Ext.extend(Ext.form.TextArea,Ext.form.TextField,{growMin:60,growMax:1000,preventScrollbars:false,onRender:function(A,B){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,A,B);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){if(this.textSizeEl){this.textSizeEl.parentNode.removeChild(this.textSizeEl)}Ext.form.TextArea.superclass.onDestroy.call(this)},onKeyUp:function(A){if(!A.isNavKeyPress()||A.getKey()==A.ENTER){this.autoSize()}},autoSize:function(){if(!this.grow||!this.textSizeEl){return }var C=this.el;var A=C.dom.value;var D=this.textSizeEl;D.innerHTML="";D.appendChild(document.createTextNode(A));A=D.innerHTML;Ext.fly(D).setWidth(this.el.getWidth());if(A.length<1){A="&#160;&#160;"}else{if(Ext.isIE){A=A.replace(/\n/g,"<p>&#160;</p>")}A+="&#160;\n&#160;"}D.innerHTML=A;var B=Math.min(this.growMax,Math.max(D.offsetHeight,this.growMin));if(B!=this.lastHeight){this.lastHeight=B;this.el.setHeight(B);this.fireEvent("autosize",this,B)}}});Ext.form.NumberField=function(A){Ext.form.NumberField.superclass.constructor.call(this,A)};Ext.extend(Ext.form.NumberField,Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",initEvents:function(){Ext.form.NumberField.superclass.initEvents.call(this);var B="0123456789";if(this.allowDecimals){B+=this.decimalSeparator}if(this.allowNegative){B+="-"}this.stripCharsRe=new RegExp("[^"+B+"]","gi");var A=function(D){var C=D.getKey();if(!Ext.isIE&&(D.isSpecialKey()||C==D.BACKSPACE||C==D.DELETE)){return }var E=D.getCharCode();if(B.indexOf(String.fromCharCode(E))===-1){D.stopEvent()}};this.el.on("keypress",A,this)},validateValue:function(B){if(!Ext.form.NumberField.superclass.validateValue.call(this,B)){return false}if(B.length<1){return true}var A=this.parseValue(B);if(isNaN(A)){this.markInvalid(String.format(this.nanText,B));return false}if(A<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false}if(A>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false}return true},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},parseValue:function(A){return parseFloat(String(A).replace(this.decimalSeparator,"."))||""},fixPrecision:function(D){var C=isNaN(D);if(!this.allowDecimals||this.decimalPrecision==-1||C||!D){return C?"":D}var B=Math.pow(10,this.decimalPrecision+1);var A=this.decimalPrecisionFcn(D*B);A=this.decimalPrecisionFcn(A/10);return A/(B/10)},decimalPrecisionFcn:function(A){return Math.floor(A)},beforeBlur:function(){var A=this.parseValue(this.getRawValue());if(A){this.setValue(this.fixPrecision(A))}}});Ext.form.DateField=function(D){Ext.form.DateField.superclass.constructor.call(this,D);if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}this.ddMatch=null;if(this.disabledDates){var A=this.disabledDates;var C="(?:";for(var B=0;B<A.length;B++){C+=A[B];if(B!=A.length-1){C+="|"}}this.ddMatch=new RegExp(C+")")}};Ext.extend(Ext.form.DateField,Ext.form.TriggerField,{format:"m/d/y",altFormats:"m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d",disabledDays:null,disabledDaysText:"Disabled",disabledDates:null,disabledDatesText:"Disabled",minValue:null,maxValue:null,minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},validateValue:function(F){F=this.formatDate(F);if(!Ext.form.DateField.superclass.validateValue.call(this,F)){return false}if(F.length<1){return true}var C=F;F=this.parseDate(F);if(!F){this.markInvalid(String.format(this.invalidText,C,this.format));return false}var B=F.getTime();if(this.minValue&&B<this.minValue.getTime()){this.markInvalid(String.format(this.minText,this.formatDate(this.minValue)));return false}if(this.maxValue&&B>this.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false}if(this.disabledDays){var A=F.getDay();for(var E=0;E<this.disabledDays.length;E++){if(A===this.disabledDays[E]){this.markInvalid(this.disabledDaysText);return false}}}var D=this.formatDate(F);if(this.ddMatch&&this.ddMatch.test(D)){this.markInvalid(String.format(this.disabledDatesText,D));return false}return true},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(A){Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(A)))},parseDate:function(B){if(!B||B instanceof Date){return B}var A=Date.parseDate(B,this.format);if(!A&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|")}for(var C=0,D=this.altFormatsArray.length;C<D&&!A;C++){A=Date.parseDate(B,this.altFormatsArray[C])}}return A},formatDate:function(A){return(!A||!(A instanceof Date))?A:A.dateFormat(this.format)},menuListeners:{select:function(A,B){this.setValue(B)},show:function(){this.onFocus()},hide:function(){this.focus.defer(10,this);var A=this.menuListeners;this.menu.un("select",A.select,this);this.menu.un("show",A.show,this);this.menu.un("hide",A.hide,this)}},onTriggerClick:function(){if(this.disabled){return }if(this.menu==null){this.menu=new Ext.menu.DateMenu()}Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.ddMatch,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.on(Ext.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?")},beforeBlur:function(){var A=this.parseDate(this.getRawValue());if(A){this.setValue(A)}}});Ext.form.ComboBox=function(F){Ext.form.ComboBox.superclass.constructor.call(this,F);this.addEvents({"expand":true,"collapse":true,"beforeselect":true,"select":true,"beforequery":true});if(this.transform){this.allowDomMove=false;var E=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=E.name}if(!this.store){this.mode="local";var H=[],D=E.options;for(var C=0,B=D.length;C<B;C++){var G=D[C];var A=(Ext.isIE?G.getAttributeNode("value").specified:G.hasAttribute("value"))?G.value:G.text;if(G.selected){this.value=A}H.push([A,G.text])}this.store=new Ext.data.SimpleStore({"id":0,fields:["value","text"],data:H});this.valueField="value";this.displayField="text"}E.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(E,this.autoCreate||this.defaultAutoCreate);E.parentNode.removeChild(E);this.render(this.el.parentNode)}else{E.parentNode.removeChild(E)}}this.selectedIndex=-1;if(this.mode=="local"){if(F.queryDelay===undefined){this.queryDelay=10}if(F.minChars===undefined){this.minChars=0}}};Ext.extend(Ext.form.ComboBox,Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listWidth:undefined,displayField:undefined,valueField:undefined,hiddenName:undefined,listClass:"",selectedClass:"x-combo-selected",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,triggerAction:"query",minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,editable:true,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,valueNotFoundText:undefined,onRender:function(C,B){Ext.form.ComboBox.superclass.onRender.call(this,C,B);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},"before",true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:"";this.el.dom.removeAttribute("name")}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}var A="x-combo-list";this.list=new Ext.Layer({shadow:this.shadow,cls:[A,this.listClass].join(" "),constrain:false});var D=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(D);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:A+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:A+"-inner"});this.innerList.on("mouseover",this.onViewOver,this);this.innerList.on("mousemove",this.onViewMove,this);this.innerList.setWidth(D-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:A+"-ft"});this.pageTb=new Ext.PagingToolbar(this.footer,this.store,{pageSize:this.pageSize});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<div class="'+A+'-item">{'+this.displayField+"}</div>"}this.view=new Ext.View(this.innerList,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on("click",this.onViewClick,this);this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.collapse,this);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.resizer.on("resize",function(G,E,F){this.maxHeight=F-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=E;this.innerList.setWidth(E-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}if(!this.editable){this.editable=true;this.setEditable(false)}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{"up":function(A){this.inKeyMode=true;this.selectPrev()},"down":function(A){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},"enter":function(A){this.onViewClick()},"esc":function(A){this.collapse()},"tab":function(A){this.onViewClick(false);return true},scope:this,doRelay:function(C,B,A){if(A=="down"||this.scope.isExpanded()){return Ext.KeyNav.prototype.doRelay.apply(this,arguments)}return true},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this)}if(this.forceSelection){this.on("blur",this.doForce,this)}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners()}if(this.list){this.list.destroy()}if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.collapse,this)}Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(A){if(A.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,A)}},onResize:function(A,B){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var C=Math.max(A,this.minListWidth);this.list.setWidth(C);this.innerList.setWidth(C-this.list.getFrameWidth("lr"))}},setEditable:function(A){if(A==this.editable){return }this.editable=A;if(!A){this.el.dom.setAttribute("readOnly",true);this.el.on("mousedown",this.onTriggerClick,this);this.el.addClass("x-combo-noedit")}else{this.el.dom.setAttribute("readOnly",false);this.el.un("mousedown",this.onTriggerClick,this);this.el.removeClass("x-combo-noedit")}},onBeforeLoad:function(){if(!this.hasFocus){return }this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return }if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(!this.selectByValue(this.value,true)){this.select(0,true)}}else{this.selectNext();if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.onEmptyResults()}},onTypeAhead:function(){if(this.store.getCount()>0){var D=this.store.getAt(0);var C=D.data[this.displayField];var A=C.length;var B=this.getRawValue().length;if(B!=A){this.setRawValue(C);this.selectText(B,C.length)}}},onSelect:function(A,B){if(this.fireEvent("beforeselect",this,A,B)!==false){this.setValue(A.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,A,B)}},getValue:function(){if(this.valueField){return typeof this.value!="undefined"?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText()},setValue:function(A){var C=A;if(this.valueField){var B=this.findRecord(this.valueField,A);if(B){C=B.data[this.displayField]}else{if(this.valueNotFoundText!==undefined){C=this.valueNotFoundText}}}this.lastSelectionText=C;if(this.hiddenField){this.hiddenField.value=A}Ext.form.ComboBox.superclass.setValue.call(this,C);this.value=A},findRecord:function(C,B){var A;if(this.store.getCount()>0){this.store.each(function(D){if(D.data[C]==B){A=D;return false}})}return A},onViewMove:function(B,A){this.inKeyMode=false},onViewOver:function(D,C){if(this.inKeyMode){return }var B=this.view.findItemFromChild(C);if(B){var A=this.view.indexOf(B);this.select(A,false)}},onViewClick:function(B){var A=this.view.getSelectedIndexes()[0];var C=this.store.getAt(A);if(C){this.onSelect(C,A)}if(B!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var A=this.innerList.dom;var B=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight);this.innerList.setHeight(B<this.maxHeight?"auto":this.maxHeight);this.list.beginUpdate();this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight);this.list.alignTo(this.el,this.listAlign);this.list.endUpdate()},onEmptyResults:function(){this.collapse()},isExpanded:function(){return this.list.isVisible()},selectByValue:function(A,C){if(A!==undefined&&A!==null){var B=this.findRecord(this.valueField||this.displayField,A);if(B){this.select(this.store.indexOf(B),C);return true}}return false},select:function(C,B){this.selectedIndex=C;this.view.select(C);if(B!==false){var A=this.view.getNode(C);if(A){this.innerList.scrollChildIntoView(A,false)}}},selectNext:function(){var A=this.store.getCount();if(A>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex<A-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var A=this.store.getCount();if(A>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!=0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(A){if(this.editable!==false&&!A.isSpecialKey()){this.lastKey=A.getKey();this.dqTask.delay(this.queryDelay)}},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?"":this.lastSelectionText;this.applyEmptyText()}},doQuery:function(C,B){if(C===undefined||C===null){C=""}var A={query:C,forceAll:B,combo:this,cancel:false};if(this.fireEvent("beforequery",A)===false||A.cancel){return false}C=A.query;B=A.forceAll;if(B===true||(C.length>=this.minChars)){if(this.lastQuery!=C){this.lastQuery=C;if(this.mode=="local"){this.selectedIndex=-1;if(B){this.store.clearFilter()}else{this.store.filter(this.displayField,C)}this.onLoad()}else{this.store.baseParams[this.queryParam]=C;this.store.load({params:this.getParams(C)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(A){var B={};if(this.pageSize){B.start=0;B.limit=this.pageSize}return B},collapse:function(){if(!this.isExpanded()){return }this.list.hide();Ext.get(document).un("mousedown",this.collapseIf,this);Ext.get(document).un("mousewheel",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(A){if(!A.within(this.wrap)&&!A.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return }this.list.alignTo(this.el,this.listAlign);this.list.show();Ext.get(document).on("mousedown",this.collapseIf,this);Ext.get(document).on("mousewheel",this.collapseIf,this);this.fireEvent("expand",this)},onTriggerClick:function(){if(this.disabled){return }if(this.isExpanded()){this.collapse();this.el.focus()}else{this.hasFocus=true;if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.form.Checkbox=function(A){Ext.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true})};Ext.extend(Ext.form.Checkbox,Ext.form.Field,{focusClass:"x-form-check-focus",fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},boxLabel:undefined,onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this)},getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},onRender:function(A,B){Ext.form.Checkbox.superclass.onRender.call(this,A,B);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}},initValue:Ext.emptyFn,getValue:function(){if(this.rendered){return this.el.dom.checked}return false},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(A){this.checked=(A===true||A==="true"||A=="1"||String(A).toLowerCase()=="on");if(this.el&&this.el.dom){this.el.dom.checked=this.checked}this.fireEvent("check",this,this.checked)}});Ext.form.Radio=function(){Ext.form.Radio.superclass.constructor.apply(this,arguments)};Ext.extend(Ext.form.Radio,Ext.form.Checkbox,{inputType:"radio",getGroupValue:function(){return this.el.up("form").child("input[name="+this.el.dom.name+"]:checked",true).value}});Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true})},createFontOptions:function(){var F=[],A=this.fontFamilies,B,E;for(var D=0,C=A.length;D<C;D++){B=A[D];E=B.toLowerCase();F.push('<option value="',E,'" style="font-family:',B,';"',(this.defaultFont==E?' selected="true">':">"),B,"</option>")}return F.join("")},createToolbar:function(B){function C(F,D,E){return{id:F,cls:"x-btn-icon x-edit-"+F,enableToggle:D!==false,scope:B,handler:E||B.relayBtnCmd,clickEvent:"mousedown",tooltip:B.buttonTips[F]||undefined,tabIndex:-1}}var A=new Ext.Toolbar(this.wrap.dom.firstChild);A.el.on("click",function(D){D.preventDefault()});if(this.enableFont&&!Ext.isSafari){this.fontSelect=A.el.createChild({tag:"select",tabIndex:-1,cls:"x-font-select",html:this.createFontOptions()});this.fontSelect.on("change",function(){var D=this.fontSelect.dom.value;this.relayCmd("fontname",D);this.deferFocus()},this);A.add(this.fontSelect.dom,"-")}if(this.enableFormat){A.add(C("bold"),C("italic"),C("underline"))}if(this.enableFontSize){A.add("-",C("increasefontsize",false,this.adjustFont),C("decreasefontsize",false,this.adjustFont))}if(this.enableColors){A.add("-",{id:"forecolor",cls:"x-btn-icon x-edit-forecolor",clickEvent:"mousedown",tooltip:B.buttonTips["forecolor"]||undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,selectHandler:function(D,E){this.execCmd("forecolor",Ext.isSafari||Ext.isIE?"#"+E:E);this.deferFocus()},scope:this,clickEvent:"mousedown"})},{id:"backcolor",cls:"x-btn-icon x-edit-backcolor",clickEvent:"mousedown",tooltip:B.buttonTips["backcolor"]||undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,selectHandler:function(D,E){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",E);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isSafari||Ext.isIE?"#"+E:E);this.deferFocus()}},scope:this,clickEvent:"mousedown"})})}if(this.enableAlignments){A.add("-",C("justifyleft"),C("justifycenter"),C("justifyright"))}if(!Ext.isSafari){if(this.enableLinks){A.add("-",C("createlink",false,this.createLink))}if(this.enableLists){A.add("-",C("insertorderedlist"),C("insertunorderedlist"))}if(this.enableSourceEdit){A.add("-",C("sourceedit",true,function(D){this.toggleSourceEdit(D.pressed)}))}}this.tb=A},getDocMarkup:function(){return'<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>'},onRender:function(C,D){Ext.form.HtmlEditor.superclass.onRender.call(this,C,D);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.tb.items.each(function(E){if(E.id!="sourceedit"){E.disable()}});var B=document.createElement("iframe");B.name=Ext.id();B.frameBorder="no";B.src="javascript:false";this.wrap.dom.appendChild(B);this.iframe=B;if(Ext.isIE){this.doc=B.contentWindow.document;this.win=B.contentWindow}else{this.doc=(B.contentDocument||window.frames[B.name].document);this.win=window.frames[B.name]}this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A={run:function(){if(this.doc.body||this.doc.readyState=="complete"){this.doc.designMode="on";Ext.TaskMgr.stop(A);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(A);if(!this.width){this.setSize(this.el.getSize())}},onResize:function(B,C){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof B=="number"){var D=B-this.wrap.getFrameWidth("lr");this.el.setWidth(this.adjustWidth("textarea",D));this.iframe.style.width=D+"px"}if(typeof C=="number"){var A=C-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(this.adjustWidth("textarea",A));this.iframe.style.height=A+"px";if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(A-(this.iframePad*2))+"px"}}}},toggleSourceEdit:function(A){if(A===undefined){A=!this.sourceEditMode}this.sourceEditMode=A===true;var B=this.tb.items.get("sourceedit");if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);return }if(this.sourceEditMode){this.tb.items.each(function(C){if(C.id!="sourceedit"){C.disable()}});this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus()}else{if(this.initialized){this.tb.items.each(function(C){C.enable()})}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus()}this.setSize(this.wrap.getSize());this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!="http://"){this.relayCmd("createlink",A)}},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(A){Ext.form.HtmlEditor.superclass.setValue.call(this,A);this.pushValue()},cleanHtml:function(A){A=String(A);if(A.length>5){if(Ext.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}}if(A=="&nbsp;"){A=""}return A},syncValue:function(){if(this.initialized){var C=(this.doc.body||this.doc.documentElement);var D=C.innerHTML;if(Ext.isSafari){var B=C.getAttribute("style");var A=B.match(/text-align:(.*?);/i);if(A&&A[1]){D='<div style="'+A[0]+'">'+D+"</div>"}}D=this.cleanHtml(D);if(this.fireEvent("beforesync",this,D)!==false){this.el.dom.value=D;this.fireEvent("sync",this,D)}}},pushValue:function(){if(this.initialized){var A=this.el.dom.value;if(A.length<1){A="&nbsp;"}if(this.fireEvent("beforepush",this,A)!==false){(this.doc.body||this.doc.documentElement).innerHTML=A;this.fireEvent("push",this,A)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){var B=(this.doc.body||this.doc.documentElement);var A=this.el.getStyles("font-size","font-family","background-image","background-repeat");A["background-attachment"]="fixed";B.bgProperties="fixed";Ext.DomHelper.applyStyles(B,A);Ext.EventManager.on(this.doc,{"mousedown":this.onEditorEvent,"dblclick":this.onEditorEvent,"click":this.onEditorEvent,"keyup":this.onEditorEvent,buffer:100,scope:this});if(Ext.isGecko){Ext.EventManager.on(this.doc,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isSafari||Ext.isOpera){Ext.EventManager.on(this.doc,"keydown",this.fixKeys,this)}this.initialized=true;this.fireEvent("initialize",this);this.pushValue()},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy()}}A.destroy()});this.wrap.dom.innerHTML="";this.wrap.remove()}},onFirstFocus:function(){this.activated=true;this.tb.items.each(function(D){D.enable()});if(Ext.isGecko){this.win.focus();var A=this.win.getSelection();if(!A.focusNode||A.focusNode.nodeType!=3){var B=A.getRangeAt(0);B.selectNodeContents((this.doc.body||this.doc.documentElement));B.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(C){}}this.fireEvent("activate",this)},adjustFont:function(C){var B=C.id=="increasefontsize"?1:-1;if(Ext.isSafari){B*=2}var A=parseInt(this.doc.queryCommandValue("FontSize")||3,10);A=Math.max(1,A+B);this.execCmd("FontSize",A+(Ext.isSafari?"px":0))},onEditorEvent:function(A){this.updateToolbar()},updateToolbar:function(){if(!this.activated){this.onFirstFocus();return }var A=this.tb.items.map,B=this.doc;if(this.enableFont&&!Ext.isSafari){var C=(this.doc.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(C!=this.fontSelect.dom.value){this.fontSelect.dom.value=C}}if(this.enableFormat){A.bold.toggle(B.queryCommandState("bold"));A.italic.toggle(B.queryCommandState("italic"));A.underline.toggle(B.queryCommandState("underline"))}if(this.enableAlignments){A.justifyleft.toggle(B.queryCommandState("justifyleft"));A.justifycenter.toggle(B.queryCommandState("justifycenter"));A.justifyright.toggle(B.queryCommandState("justifyright"))}if(!Ext.isSafari&&this.enableLists){A.insertorderedlist.toggle(B.queryCommandState("insertorderedlist"));A.insertunorderedlist.toggle(B.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(A){this.relayCmd(A.id)},relayCmd:function(B,A){this.win.focus();this.execCmd(B,A);this.updateToolbar();this.deferFocus()},execCmd:function(B,A){this.doc.execCommand(B,false,A===undefined?null:A);this.syncValue()},applyCommand:function(B){if(B.ctrlKey){var C=B.getCharCode(),A;if(C>0){C=String.fromCharCode(C);switch(C){case"b":A="bold";break;case"i":A="italic";break;case"u":A="underline";break}if(A){this.win.focus();this.execCmd(A);this.deferFocus();B.preventDefault()}}}},insertAtCursor:function(B){if(!this.activated){return }if(Ext.isIE){this.win.focus();var A=this.doc.selection.createRange();if(A){A.collapse(true);A.pasteHTML(B);this.syncValue();this.deferFocus()}}else{if(Ext.isGecko||Ext.isOpera){this.win.focus();this.execCmd("InsertHTML",B);this.deferFocus()}else{if(Ext.isSafari){this.execCmd("InsertText",B);this.deferFocus()}}}},fixKeys:function(){if(Ext.isIE){return function(D){var A=D.getKey(),C;if(A==D.TAB){D.stopEvent();C=this.doc.selection.createRange();if(C){C.collapse(true);C.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(A==D.ENTER){C=this.doc.selection.createRange();if(C){var B=C.parentElement();if(!B||B.tagName.toLowerCase()!="li"){D.stopEvent();C.pasteHTML("<br />");C.collapse(false);C.select()}}}}}}else{if(Ext.isOpera){return function(B){var A=B.getKey();if(A==B.TAB){B.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isSafari){return function(B){var A=B.getKey();if(A==B.TAB){B.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.form.BasicForm=function(A,B){Ext.apply(this,B);this.items=new Ext.util.MixedCollection(false,function(C){return C.id||(C.id=Ext.id())});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(A){this.initEl(A)}Ext.form.BasicForm.superclass.constructor.call(this)};Ext.extend(Ext.form.BasicForm,Ext.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,waitMsgTarget:undefined,initEl:function(A){this.el=Ext.get(A);this.id=this.el.id||Ext.id();this.el.on("submit",this.onSubmit,this);this.el.addClass("x-form")},onSubmit:function(A){A.stopEvent()},isValid:function(){var A=true;this.items.each(function(B){if(!B.validate()){A=false}});return A},isDirty:function(){var A=false;this.items.each(function(B){if(B.isDirty()){A=true;return false}});return A},doAction:function(B,A){if(typeof B=="string"){B=new Ext.form.Action.ACTION_TYPES[B](this,A)}if(this.fireEvent("beforeaction",this,B)!==false){this.beforeAction(B);B.run.defer(100,B)}return this},submit:function(A){this.doAction("submit",A);return this},load:function(A){this.doAction("load",A);return this},updateRecord:function(B){B.beginEdit();var A=B.fields;A.each(function(C){var D=this.findField(C.name);if(D){B.set(C.name,D.getValue())}},this);B.endEdit();return this},loadRecord:function(A){this.setValues(A.data);return this},beforeAction:function(A){var B=A.options;if(B.waitMsg){if(this.waitMsgTarget===true){this.el.mask(B.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(B.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(B.waitMsg,B.waitTitle||this.waitTitle||"Please Wait...")}}}},afterAction:function(B,A){this.activeAction=null;var C=B.options;if(C.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(A){if(C.reset){this.reset()}Ext.callback(C.success,C.scope,[this,B]);this.fireEvent("actioncomplete",this,B)}else{Ext.callback(C.failure,C.scope,[this,B]);this.fireEvent("actionfailed",this,B)}},findField:function(B){var A=this.items.get(B);if(!A){this.items.each(function(C){if(C.isFormField&&(C.dataIndex==B||C.id==B||C.getName()==B)){A=C;return false}})}return A||null},markInvalid:function(E){if(E instanceof Array){for(var D=0,A=E.length;D<A;D++){var C=E[D];var F=this.findField(C.id);if(F){F.markInvalid(C.msg)}}}else{var B,G;for(G in E){if(typeof E[G]!="function"&&(B=this.findField(G))){B.markInvalid(E[G])}}}return this},setValues:function(G){if(G instanceof Array){for(var C=0,A=G.length;C<A;C++){var B=G[C];var E=this.findField(B.id);if(E){E.setValue(B.value);if(this.trackResetOnLoad){E.originalValue=E.getValue()}}}}else{var D,F;for(F in G){if(typeof G[F]!="function"&&(D=this.findField(F))){D.setValue(G[F]);if(this.trackResetOnLoad){D.originalValue=D.getValue()}}}}return this},getValues:function(B){var A=Ext.lib.Ajax.serializeForm(this.el.dom);if(B===true){return A}return Ext.urlDecode(A)},clearInvalid:function(){this.items.each(function(A){A.clearInvalid()});return this},reset:function(){this.items.each(function(A){A.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(A){this.items.remove(A);return this},render:function(){this.items.each(function(A){if(A.isFormField&&!A.rendered&&document.getElementById(A.id)){A.applyTo(A.id)}});return this},applyToFields:function(A){this.items.each(function(B){Ext.apply(B,A)});return this},applyIfToFields:function(A){this.items.each(function(B){Ext.applyIf(B,A)});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.form.Form=function(A){Ext.form.Form.superclass.constructor.call(this,null,A);this.url=this.url||this.action;if(!this.root){this.root=new Ext.form.Layout(Ext.applyIf({id:Ext.id()},A))}this.active=this.root;this.buttons=[];this.addEvents({clientvalidation:true})};Ext.extend(Ext.form.Form,Ext.form.BasicForm,{buttonAlign:"center",minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,column:function(B){var A=new Ext.form.Column(B);this.start(A);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end()}return A},fieldset:function(B){var A=new Ext.form.FieldSet(B);this.start(A);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end()}return A},container:function(B){var A=new Ext.form.Layout(B);this.start(A);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end()}return A},start:function(A){Ext.applyIf(A,{"labelAlign":this.active.labelAlign,"labelWidth":this.active.labelWidth,"itemCls":this.active.itemCls});this.active.stack.push(A);A.ownerCt=this.active;this.active=A;return this},end:function(){if(this.active==this.root){return this}this.active=this.active.ownerCt;return this},add:function(){this.active.stack.push.apply(this.active.stack,arguments);var D=[];for(var C=0,A=arguments,B=A.length;C<B;C++){if(A[C].isFormField){D.push(A[C])}}if(D.length>0){Ext.form.Form.superclass.add.apply(this,D)}return this},render:function(E){E=Ext.get(E);var G=this.autoCreate||{tag:"form",method:this.method||"POST",id:this.id||Ext.id()};this.initEl(E.createChild(G));this.root.render(this.el);this.items.each(function(I){I.render("x-form-el-"+I.id)});if(this.buttons.length>0){var C=this.el.createChild({cls:"x-form-btns-ct",cn:{cls:"x-form-btns x-form-btns-"+this.buttonAlign,html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'}},null,true);var F=C.getElementsByTagName("tr")[0];for(var D=0,B=this.buttons.length;D<B;D++){var A=this.buttons[D];var H=document.createElement("td");H.className="x-form-btn-td";A.render(F.appendChild(H))}}if(this.monitorValid){this.startMonitoring()}return this},addButton:function(D,B,A){var E={handler:B,scope:A,minWidth:this.minButtonWidth,hideParent:true};if(typeof D=="string"){E.text=D}else{Ext.apply(E,D)}var C=new Ext.Button(null,E);this.buttons.push(C);return C},startMonitoring:function(){if(!this.bound){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false},bindHandler:function(){if(!this.bound){return false}var D=true;this.items.each(function(E){if(!E.isValid(true)){D=false;return false}});for(var C=0,A=this.buttons.length;C<A;C++){var B=this.buttons[C];if(B.formBind===true&&B.disabled===D){B.setDisabled(!D)}}this.fireEvent("clientvalidation",this,D)}});Ext.Form=Ext.form.Form;Ext.form.Action=function(B,A){this.form=B;this.options=A||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",failureType:undefined,response:undefined,result:undefined,run:function(A){},success:function(A){},handleResponse:function(A){},failure:function(A){this.response=A;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(A){this.response=A;if(!A.responseText){return true}this.result=this.handleResponse(A);return this.result},getUrl:function(B){var A=this.options.url||this.form.url||this.form.el.dom.action;if(B){var C=this.getParams();if(C){A+=(A.indexOf("?")!=-1?"&":"?")+C}}return A},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var A=this.form.baseParams;var B=this.options.params;if(B){if(typeof B=="object"){B=Ext.urlEncode(Ext.applyIf(B,A))}else{if(typeof B=="string"&&A){B+="&"+Ext.urlEncode(A)}}}else{if(A){B=Ext.urlEncode(A)}}return B},createCallback:function(){return{success:this.success,failure:this.failure,scope:this,timeout:(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(B,A){Ext.form.Action.Submit.superclass.constructor.call(this,B,A)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var B=this.options;var C=this.getMethod();var A=C=="POST";if(B.clientValidation===false||this.form.isValid()){Ext.Ajax.request(Ext.apply(this.createCallback(),{form:this.form.el.dom,url:this.getUrl(!A),method:C,params:A?this.getParams():null,isUpload:this.form.fileUpload}))}else{if(B.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(B){var A=this.processResponse(B);if(A===true||A.success){this.form.afterAction(this,true);return }if(A.errors){this.form.markInvalid(A.errors);this.failureType=Ext.form.Action.SERVER_INVALID}this.form.afterAction(this,false)},handleResponse:function(F){if(this.form.errorReader){var B=this.form.errorReader.read(F);var D=[];if(B.records){for(var C=0,A=B.records.length;C<A;C++){var E=B.records[C];D[C]=E.data}}if(D.length<1){D=null}return{success:B.success,errors:D}}return Ext.decode(F.responseText)}});Ext.form.Action.Load=function(B,A){Ext.form.Action.Load.superclass.constructor.call(this,B,A);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(),{method:this.getMethod(),url:this.getUrl(false),params:this.getParams()}))},success:function(B){var A=this.processResponse(B);if(A===true||!A.success||!A.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return }this.form.clearInvalid();this.form.setValues(A.data);this.form.afterAction(this,true)},handleResponse:function(B){if(this.form.reader){var C=this.form.reader.read(B);var A=C.records&&C.records[0]?C.records[0].data:null;return{success:C.success,data:A}}return Ext.decode(B.responseText)}});Ext.form.Action.ACTION_TYPES={"load":Ext.form.Action.Load,"submit":Ext.form.Action.Submit};Ext.form.Layout=function(A){Ext.form.Layout.superclass.constructor.call(this,A);this.stack=[]};Ext.extend(Ext.form.Layout,Ext.Component,{clear:true,labelSeparator:":",hideLabels:false,defaultAutoCreate:{tag:"div",cls:"x-form-ct"},onRender:function(E,G){if(this.el){this.el=Ext.get(this.el)}else{var F=this.getAutoCreate();this.el=E.createChild(F,G)}if(this.style){this.el.applyStyles(this.style)}if(this.labelAlign){this.el.addClass("x-form-label-"+this.labelAlign)}if(this.hideLabels){this.labelStyle="display:none";this.elementStyle="padding-left:0;"}else{if(typeof this.labelWidth=="number"){this.labelStyle="width:"+this.labelWidth+"px;";this.elementStyle="padding-left:"+((this.labelWidth+(typeof this.labelPad=="number"?this.labelPad:5))+"px")+";"}if(this.labelAlign=="top"){this.labelStyle="width:auto;";this.elementStyle="padding-left:0;"}}var D=this.stack;var A=D.length;if(A>0){if(!this.fieldTpl){var C=new Ext.Template('<div class="x-form-item {5}">','<label for="{0}" style="{2}">{1}{4}</label>','<div class="x-form-element" id="x-form-el-{0}" style="{3}">',"</div>",'</div><div class="x-form-clear-left"></div>');C.disableFormats=true;C.compile();Ext.form.Layout.prototype.fieldTpl=C}for(var B=0;B<A;B++){if(D[B].isFormField){this.renderField(D[B])}else{this.renderComponent(D[B])}}}if(this.clear){this.el.createChild({cls:"x-form-clear"})}},renderField:function(A){this.fieldTpl.append(this.el,[A.id,A.fieldLabel,A.labelStyle||this.labelStyle||"",this.elementStyle||"",typeof A.labelSeparator=="undefined"?this.labelSeparator:A.labelSeparator,A.itemCls||this.itemCls||""])},renderComponent:function(A){A.render(this.el)}});Ext.form.Column=function(A){Ext.form.Column.superclass.constructor.call(this,A)};Ext.extend(Ext.form.Column,Ext.form.Layout,{defaultAutoCreate:{tag:"div",cls:"x-form-ct x-form-column"},onRender:function(B,A){Ext.form.Column.superclass.onRender.call(this,B,A);if(this.width){this.el.setWidth(this.width)}}});Ext.form.FieldSet=function(A){Ext.form.FieldSet.superclass.constructor.call(this,A)};Ext.extend(Ext.form.FieldSet,Ext.form.Layout,{defaultAutoCreate:{tag:"fieldset",cn:{tag:"legend"}},onRender:function(A,B){Ext.form.FieldSet.superclass.onRender.call(this,A,B);if(this.legend){this.setLegend(this.legend)}},setLegend:function(A){if(this.rendered){this.el.child("legend").update(A)}}});Ext.form.VTypes=function(){var D=/^[a-zA-Z_]+$/;var C=/^[a-zA-Z0-9_]+$/;var B=/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;var A=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{"email":function(E){return B.test(E)},"emailText":'This field should be an e-mail address in the format "user@domain.com"',"emailMask":/[a-z0-9_\.\-@]/i,"url":function(E){return A.test(E)},"urlText":'This field should be a URL in the format "http://www.domain.com"',"alpha":function(E){return D.test(E)},"alphaText":"This field should only contain letters and _","alphaMask":/[a-z_]/i,"alphanum":function(E){return C.test(E)},"alphanumText":"This field should only contain letters, numbers and _","alphanumMask":/[a-z0-9_]/i}}();Ext.LayoutManager=function(B,A){Ext.LayoutManager.superclass.constructor.call(this);this.el=Ext.get(B);if(this.el.dom==document.body&&Ext.isIE&&!A.allowScroll){document.body.scroll="no"}else{if(this.el.dom!=document.body&&this.el.getStyle("position")=="static"){this.el.position("relative")}}this.id=this.el.id;this.el.addClass("x-layout-container");this.monitorWindowResize=true;this.regions={};this.addEvents({"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true});this.updating=false;Ext.EventManager.onWindowResize(this.onWindowResize,this,true)};Ext.extend(Ext.LayoutManager,Ext.util.Observable,{isUpdating:function(){return this.updating},beginUpdate:function(){this.updating=true},endUpdate:function(A){this.updating=false;if(!A){this.layout()}},layout:function(){},onRegionResized:function(B,A){this.fireEvent("regionresized",B,A);this.layout()},onRegionCollapsed:function(A){this.fireEvent("regioncollapsed",A)},onRegionExpanded:function(A){this.fireEvent("regionexpanded",A)},getViewSize:function(){var A;if(this.el.dom!=document.body){A=this.el.getSize()}else{A={width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}A.width-=this.el.getBorderWidth("lr")-this.el.getPadding("lr");A.height-=this.el.getBorderWidth("tb")-this.el.getPadding("tb");return A},getEl:function(){return this.el},getRegion:function(A){return this.regions[A.toLowerCase()]},onWindowResize:function(){if(this.monitorWindowResize){this.layout()}}});Ext.BorderLayout=function(E,D){D=D||{};Ext.BorderLayout.superclass.constructor.call(this,E,D);this.factory=D.factory||Ext.BorderLayout.RegionFactory;for(var B=0,C=this.factory.validRegions.length;B<C;B++){var A=this.factory.validRegions[B];if(D[A]){this.addRegion(A,D[A])}}};Ext.extend(Ext.BorderLayout,Ext.LayoutManager,{addRegion:function(B,A){if(!this.regions[B]){var C=this.factory.create(B,this,A);this.bindRegion(B,C)}return this.regions[B]},bindRegion:function(A,B){this.regions[A]=B;B.on("visibilitychange",this.layout,this);B.on("paneladded",this.layout,this);B.on("panelremoved",this.layout,this);B.on("invalidated",this.layout,this);B.on("resized",this.onRegionResized,this);B.on("collapsed",this.onRegionCollapsed,this);B.on("expanded",this.onRegionExpanded,this)},layout:function(){if(this.updating){return }var I=this.getViewSize();var K=I.width,O=I.height;var F=K,D=O,H=0,G=0;var J=this.regions;var M=J["north"],L=J["south"],A=J["west"],P=J["east"],Q=J["center"];if(M&&M.isVisible()){var R=M.getBox();var N=M.getMargins();R.width=K-(N.left+N.right);R.x=N.left;R.y=N.top;H=R.height+R.y+N.bottom;D-=H;M.updateBox(this.safeBox(R))}if(L&&L.isVisible()){var R=L.getBox();var N=L.getMargins();R.width=K-(N.left+N.right);R.x=N.left;var E=(R.height+N.top+N.bottom);R.y=O-E+N.top;D-=E;L.updateBox(this.safeBox(R))}if(A&&A.isVisible()){var R=A.getBox();var N=A.getMargins();R.height=D-(N.top+N.bottom);R.x=N.left;R.y=H+N.top;var C=(R.width+N.left+N.right);G+=C;F-=C;A.updateBox(this.safeBox(R))}if(P&&P.isVisible()){var R=P.getBox();var N=P.getMargins();R.height=D-(N.top+N.bottom);var C=(R.width+N.left+N.right);R.x=K-C+N.left;R.y=H+N.top;F-=C;P.updateBox(this.safeBox(R))}if(Q){var N=Q.getMargins();var B={x:G+N.left,y:H+N.top,width:F-(N.left+N.right),height:D-(N.top+N.bottom)};Q.updateBox(this.safeBox(B))}this.el.repaint();this.fireEvent("layout",this)},safeBox:function(A){A.width=Math.max(0,A.width);A.height=Math.max(0,A.height);return A},add:function(B,A){B=B.toLowerCase();return this.regions[B].add(A)},remove:function(B,A){B=B.toLowerCase();return this.regions[B].remove(A)},findPanel:function(D){var A=this.regions;for(var C in A){if(typeof A[C]!="function"){var B=A[C].getPanel(D);if(B){return B}}}return null},showPanel:function(D){var A=this.regions;for(var B in A){var C=A[B];if(typeof C!="function"){if(C.hasPanel(D)){return C.showPanel(D)}}}return null},restoreState:function(A){if(!A){A=Ext.state.Manager}var B=new Ext.LayoutStateManager();B.init(this,A)},batchAdd:function(C){this.beginUpdate();for(var B in C){var A=this.regions[B];if(A){this.addTypedPanels(A,C[B])}}this.endUpdate()},addTypedPanels:function(B,E){if(typeof E=="string"){B.add(new Ext.ContentPanel(E))}else{if(E instanceof Array){for(var C=0,A=E.length;C<A;C++){this.addTypedPanels(B,E[C])}}else{if(!E.events){var D=E.el;delete E.el;B.add(new Ext.ContentPanel(D||Ext.id(),E))}else{B.add(E)}}}}});Ext.BorderLayout.create=function(I,H){var G=new Ext.BorderLayout(H||document.body,I);G.beginUpdate();var F=Ext.BorderLayout.RegionFactory.validRegions;for(var C=0,D=F.length;C<D;C++){var E=F[C];if(G.regions[E]&&I[E].panels){var B=G.regions[E];var A=I[E].panels;G.addTypedPanels(B,A)}}G.endUpdate();return G};Ext.BorderLayout.RegionFactory={validRegions:["north","south","east","west","center"],create:function(B,C,A){B=B.toLowerCase();if(A.lightweight||A.basic){return new Ext.BasicLayoutRegion(C,A,B)}switch(B){case"north":return new Ext.NorthLayoutRegion(C,A);case"south":return new Ext.SouthLayoutRegion(C,A);case"east":return new Ext.EastLayoutRegion(C,A);case"west":return new Ext.WestLayoutRegion(C,A);case"center":return new Ext.CenterLayoutRegion(C,A)}throw'Layout region "'+B+'" not supported.'}};Ext.BasicLayoutRegion=function(D,C,B,A){this.mgr=D;this.position=B;this.events={"beforeremove":true,"invalidated":true,"visibilitychange":true,"paneladded":true,"panelremoved":true,"collapsed":true,"expanded":true,"slideshow":true,"slidehide":true,"panelactivated":true,"resized":true};this.panels=new Ext.util.MixedCollection();this.panels.getKey=this.getPanelId.createDelegate(this);this.box=null;this.activePanel=null;if(A!==true){this.applyConfig(C)}};Ext.extend(Ext.BasicLayoutRegion,Ext.util.Observable,{getPanelId:function(A){return A.getId()},applyConfig:function(A){this.margins=A.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.config=A},resizeTo:function(A){var B=this.el?this.el:(this.activePanel?this.activePanel.getEl():null);if(B){switch(this.position){case"east":case"west":B.setWidth(A);this.fireEvent("resized",this,A);break;case"north":case"south":B.setHeight(A);this.fireEvent("resized",this,A);break}}},getBox:function(){return this.activePanel?this.activePanel.getEl().getBox(false,true):null},getMargins:function(){return this.margins},updateBox:function(A){this.box=A;var B=this.activePanel.getEl();B.dom.style.left=A.x+"px";B.dom.style.top=A.y+"px";this.activePanel.setSize(A.width,A.height)},getEl:function(){return this.activePanel},isVisible:function(){return this.activePanel?true:false},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false);this.activePanel.getEl().setLeftTop(-10000,-10000)}this.activePanel=A;A.setActiveState(true);if(this.box){A.setSize(this.box.width,this.box.height)}this.fireEvent("panelactivated",this,A);this.fireEvent("invalidated")},showPanel:function(A){if(A=this.getPanel(A)){this.setActivePanel(A)}return A},getActivePanel:function(){return this.activePanel},add:function(A){if(arguments.length>1){for(var B=0,D=arguments.length;B<D;B++){this.add(arguments[B])}return null}if(this.hasPanel(A)){this.showPanel(A);return A}var C=A.getEl();if(C.dom.parentNode!=this.mgr.el.dom){this.mgr.el.dom.appendChild(C.dom)}if(A.setRegion){A.setRegion(this)}this.panels.add(A);C.setStyle("position","absolute");if(!A.background){this.setActivePanel(A);if(this.config.initialSize&&this.panels.getCount()==1){this.resizeTo(this.config.initialSize)}}this.fireEvent("paneladded",this,A);return A},hasPanel:function(A){if(typeof A=="object"){A=A.getId()}return this.getPanel(A)?true:false},remove:function(D,B){D=this.getPanel(D);if(!D){return null}var C={};this.fireEvent("beforeremove",this,D,C);if(C.cancel===true){return null}var A=D.getId();this.panels.removeKey(A);return D},getPanel:function(A){if(typeof A=="object"){return A}return this.panels.get(A)},getPosition:function(){return this.position}});Ext.LayoutRegion=function(D,C,A){Ext.LayoutRegion.superclass.constructor.call(this,D,C,A,true);var B=Ext.DomHelper;this.el=B.append(D.el.dom,{tag:"div",cls:"x-layout-panel x-layout-panel-"+this.position},true);this.titleEl=B.append(this.el.dom,{tag:"div",unselectable:"on",cls:"x-unselectable x-layout-panel-hd x-layout-title-"+this.position,children:[{tag:"span",cls:"x-unselectable x-layout-panel-hd-text",unselectable:"on",html:"&#160;"},{tag:"div",cls:"x-unselectable x-layout-panel-hd-tools",unselectable:"on"}]},true);this.titleEl.enableDisplayMode();this.titleTextEl=this.titleEl.dom.firstChild;this.tools=Ext.get(this.titleEl.dom.childNodes[1],true);this.closeBtn=this.createTool(this.tools.dom,"x-layout-close");this.closeBtn.enableDisplayMode();this.closeBtn.on("click",this.closeClicked,this);this.closeBtn.hide();this.createBody(C);this.visible=true;this.collapsed=false;if(C.hideWhenEmpty){this.hide();this.on("paneladded",this.validateVisibility,this);this.on("panelremoved",this.validateVisibility,this)}this.applyConfig(C)};Ext.extend(Ext.LayoutRegion,Ext.BasicLayoutRegion,{createBody:function(){this.bodyEl=this.el.createChild({tag:"div",cls:"x-layout-panel-body"})},applyConfig:function(B){if(B.collapsible&&this.position!="center"&&!this.collapsedEl){var A=Ext.DomHelper;if(B.titlebar!==false){this.collapseBtn=this.createTool(this.tools.dom,"x-layout-collapse-"+this.position);this.collapseBtn.on("click",this.collapse,this);this.collapseBtn.enableDisplayMode();if(B.showPin===true||this.showPin){this.stickBtn=this.createTool(this.tools.dom,"x-layout-stick");this.stickBtn.enableDisplayMode();this.stickBtn.on("click",this.expand,this);this.stickBtn.hide()}}this.collapsedEl=A.append(this.mgr.el.dom,{cls:"x-layout-collapsed x-layout-collapsed-"+this.position,children:[{cls:"x-layout-collapsed-tools",children:[{cls:"x-layout-ctools-inner"}]}]},true);if(B.floatable!==false){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.collapseClick,this)}if(B.collapsedTitle&&(this.position=="north"||this.position=="south")){this.collapsedTitleTextEl=A.append(this.collapsedEl.dom,{tag:"div",cls:"x-unselectable x-layout-panel-hd-text",id:"message",unselectable:"on",style:{"float":"left"}});this.collapsedTitleTextEl.innerHTML=B.collapsedTitle}this.expandBtn=this.createTool(this.collapsedEl.dom.firstChild.firstChild,"x-layout-expand-"+this.position);this.expandBtn.on("click",this.expand,this)}if(this.collapseBtn){this.collapseBtn.setVisible(B.collapsible==true)}this.cmargins=B.cmargins||this.cmargins||(this.position=="west"||this.position=="east"?{top:0,left:2,right:2,bottom:0}:{top:2,left:0,right:0,bottom:2});this.margins=B.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.bottomTabs=B.tabPosition!="top";this.autoScroll=B.autoScroll||false;if(this.autoScroll){this.bodyEl.setStyle("overflow","auto")}else{this.bodyEl.setStyle("overflow","hidden")}if((!B.titlebar&&!B.title)||B.titlebar===false){this.titleEl.hide()}else{this.titleEl.show();if(B.title){this.titleTextEl.innerHTML=B.title}}this.duration=B.duration||0.3;this.slideDuration=B.slideDuration||0.45;this.config=B;if(B.collapsed){this.collapse(true)}if(B.hidden){this.hide()}},isVisible:function(){return this.visible},setCollapsedTitle:function(A){A=A||"&#160;";if(this.collapsedTitleTextEl){this.collapsedTitleTextEl.innerHTML=A}},getBox:function(){var A;if(!this.collapsed){A=this.el.getBox(false,true)}else{A=this.collapsedEl.getBox(false,true)}return A},getMargins:function(){return this.collapsed?this.cmargins:this.margins},highlight:function(){this.el.addClass("x-layout-panel-dragover")},unhighlight:function(){this.el.removeClass("x-layout-panel-dragover")},updateBox:function(A){this.box=A;if(!this.collapsed){this.el.dom.style.left=A.x+"px";this.el.dom.style.top=A.y+"px";this.updateBody(A.width,A.height)}else{this.collapsedEl.dom.style.left=A.x+"px";this.collapsedEl.dom.style.top=A.y+"px";this.collapsedEl.setSize(A.width,A.height)}if(this.tabs){this.tabs.autoSizeTabs()}},updateBody:function(A,C){if(A!==null){this.el.setWidth(A);A-=this.el.getBorderWidth("rl");if(this.config.adjustments){A+=this.config.adjustments[0]}}if(C!==null){this.el.setHeight(C);C=this.titleEl&&this.titleEl.isDisplayed()?C-(this.titleEl.getHeight()||0):C;C-=this.el.getBorderWidth("tb");if(this.config.adjustments){C+=this.config.adjustments[1]}this.bodyEl.setHeight(C);if(this.tabs){C=this.tabs.syncHeight(C)}}if(this.panelSize){A=A!==null?A:this.panelSize.width;C=C!==null?C:this.panelSize.height}if(this.activePanel){var B=this.activePanel.getEl();A=A!==null?A:B.getWidth();C=C!==null?C:B.getHeight();this.panelSize={width:A,height:C};this.activePanel.setSize(A,C)}if(Ext.isIE&&this.tabs){this.tabs.el.repaint()}},getEl:function(){return this.el},hide:function(){if(!this.collapsed){this.el.dom.style.left="-2000px";this.el.hide()}else{this.collapsedEl.dom.style.left="-2000px";this.collapsedEl.hide()}this.visible=false;this.fireEvent("visibilitychange",this,false)},show:function(){if(!this.collapsed){this.el.show()}else{this.collapsedEl.show()}this.visible=true;this.fireEvent("visibilitychange",this,true)},closeClicked:function(){if(this.activePanel){this.remove(this.activePanel)}},collapseClick:function(A){if(this.isSlid){A.stopPropagation();this.slideIn()}else{A.stopPropagation();this.slideOut()}},collapse:function(A){if(this.collapsed){return }this.collapsed=true;if(this.split){this.split.el.hide()}if(this.config.animate&&A!==true){this.fireEvent("invalidated",this);this.animateCollapse()}else{this.el.setLocation(-20000,-20000);this.el.hide();this.collapsedEl.show();this.fireEvent("collapsed",this);this.fireEvent("invalidated",this)}},animateCollapse:function(){},expand:function(A,B){if(A){A.stopPropagation()}if(!this.collapsed||this.el.hasActiveFx()){return }if(this.isSlid){this.afterSlideIn();B=true}this.collapsed=false;if(this.config.animate&&B!==true){this.animateExpand()}else{this.el.show();if(this.split){this.split.el.show()}this.collapsedEl.setLocation(-2000,-2000);this.collapsedEl.hide();this.fireEvent("invalidated",this);this.fireEvent("expanded",this)}},animateExpand:function(){},initTabs:function(){this.bodyEl.setStyle("overflow","hidden");var A=new Ext.TabPanel(this.bodyEl.dom,{tabPosition:this.bottomTabs?"bottom":"top",disableTooltips:this.config.disableTabTips});if(this.config.hideTabs){A.stripWrap.setDisplayed(false)}this.tabs=A;A.resizeTabs=this.config.resizeTabs===true;A.minTabWidth=this.config.minTabWidth||40;A.maxTabWidth=this.config.maxTabWidth||250;A.preferredTabWidth=this.config.preferredTabWidth||150;A.monitorResize=false;A.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");A.bodyEl.addClass("x-layout-tabs-body");this.panels.each(this.initPanelAsTab,this)},initPanelAsTab:function(B){var A=this.tabs.addTab(B.getEl().id,B.getTitle(),null,this.config.closeOnTab&&B.isClosable());if(B.tabTip!==undefined){A.setTooltip(B.tabTip)}A.on("activate",function(){this.setActivePanel(B)},this);if(this.config.closeOnTab){A.on("beforeclose",function(C,D){D.cancel=true;this.remove(B)},this)}return A},updatePanelTitle:function(B,A){if(this.activePanel==B){this.updateTitle(A)}if(this.tabs){var C=this.tabs.getTab(B.getEl().id);C.setText(A);if(B.tabTip!==undefined){C.setTooltip(B.tabTip)}}},updateTitle:function(A){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof A!="undefined"&&A.length>0?A:"&#160;")}},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false)}this.activePanel=A;A.setActiveState(true);if(this.panelSize){A.setSize(this.panelSize.width,this.panelSize.height)}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&A.isClosable())}this.updateTitle(A.getTitle());if(this.tabs){this.fireEvent("invalidated",this)}this.fireEvent("panelactivated",this,A)},showPanel:function(A){if(A=this.getPanel(A)){if(this.tabs){var B=this.tabs.getTab(A.getEl().id);if(B.isHidden()){this.tabs.unhideTab(B.id)}B.activate()}else{this.setActivePanel(A)}}return A},getActivePanel:function(){return this.activePanel},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle("&#160;");this.closeBtn.hide();this.hide()}else{if(!this.isVisible()){this.show()}}},add:function(B){if(arguments.length>1){for(var C=0,A=arguments.length;C<A;C++){this.add(arguments[C])}return null}if(this.hasPanel(B)){this.showPanel(B);return B}B.setRegion(this);this.panels.add(B);if(this.panels.getCount()==1&&!this.config.alwaysShowTabs){this.bodyEl.dom.appendChild(B.getEl().dom);if(B.background!==true){this.setActivePanel(B)}this.fireEvent("paneladded",this,B);return B}if(!this.tabs){this.initTabs()}else{this.initPanelAsTab(B)}if(B.background!==true){this.tabs.activate(B.getEl().id)}this.fireEvent("paneladded",this,B);return B},hidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.hideTab(A.getEl().id)}},unhidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.unhideTab(A.getEl().id)}},clearPanels:function(){while(this.panels.getCount()>0){this.remove(this.panels.first())}},remove:function(F,E){F=this.getPanel(F);if(!F){return null}var D={};this.fireEvent("beforeremove",this,F,D);if(D.cancel===true){return null}E=(typeof E!="undefined"?E:(this.config.preservePanels===true||F.preserve===true));var B=F.getId();this.panels.removeKey(B);if(E){document.body.appendChild(F.getEl().dom)}if(this.tabs){this.tabs.removeTab(F.getEl().id)}else{if(!E){this.bodyEl.dom.removeChild(F.getEl().dom)}}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var C=this.panels.first();var A=document.createElement("div");A.appendChild(C.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(C.getEl().dom);A=null;this.updateTitle(C.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(C)}F.setRegion(null);if(this.activePanel==F){this.activePanel=null}if(this.config.autoDestroy!==false&&E!==true){try{F.destroy()}catch(D){}}this.fireEvent("panelremoved",this,F);return F},getTabs:function(){return this.tabs},createTool:function(C,A){var B=Ext.DomHelper.append(C,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"x-layout-tools-button-inner "+A,html:"&#160;"}]},true);B.addClassOnOver("x-layout-tools-button-over");return B}});Ext.SplitLayoutRegion=function(D,C,B,A){this.cursor=A;Ext.SplitLayoutRegion.superclass.constructor.call(this,D,C,B)};Ext.extend(Ext.SplitLayoutRegion,Ext.LayoutRegion,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(B){Ext.SplitLayoutRegion.superclass.applyConfig.call(this,B);if(B.split){if(!this.split){var A=Ext.DomHelper.append(this.mgr.el.dom,{tag:"div",id:this.el.id+"-split",cls:"x-layout-split x-layout-split-"+this.position,html:"&#160;"});this.split=new Ext.SplitBar(A,this.el,this.orientation);this.split.on("moved",this.onSplitMove,this);this.split.useShim=B.useShim===true;this.split.getMaximumSize=this[this.position=="north"||this.position=="south"?"getVMaxSize":"getHMaxSize"].createDelegate(this);if(this.useSplitTips){this.split.el.dom.title=B.collapsible?this.collapsibleSplitTip:this.splitTip}if(B.collapsible){this.split.el.on("dblclick",this.collapse,this)}}if(typeof B.minSize!="undefined"){this.split.minSize=B.minSize}if(typeof B.maxSize!="undefined"){this.split.maxSize=B.maxSize}if(B.hideWhenEmpty||B.hidden){this.hideSplitter()}}},getHMaxSize:function(){var B=this.config.maxSize||10000;var A=this.mgr.getRegion("center");return Math.min(B,(this.el.getWidth()+A.getEl().getWidth())-A.getMinWidth())},getVMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getHeight()+B.getEl().getHeight())-B.getMinHeight())},onSplitMove:function(B,A){this.fireEvent("resized",this,A)},getSplitBar:function(){return this.split},hide:function(){this.hideSplitter();Ext.SplitLayoutRegion.superclass.hide.call(this)},hideSplitter:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide()}},show:function(){if(this.split){this.split.el.show()}Ext.SplitLayoutRegion.superclass.show.call(this)},beforeSlide:function(){if(Ext.isGecko){this.bodyEl.clip();if(this.tabs){this.tabs.bodyEl.clip()}if(this.activePanel){this.activePanel.getEl().clip();if(this.activePanel.beforeSlide){this.activePanel.beforeSlide()}}}},afterSlide:function(){if(Ext.isGecko){this.bodyEl.unclip();if(this.tabs){this.tabs.bodyEl.unclip()}if(this.activePanel){this.activePanel.getEl().unclip();if(this.activePanel.afterSlide){this.activePanel.afterSlide()}}}},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var A=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={"mouseout":function(B){if(!B.within(this.el,true)){A.delay(500)}},"mouseover":function(B){A.cancel()},scope:this}}this.el.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.get(document).un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return }this.isSlid=true;if(this.collapseBtn){this.collapseBtn.hide()}this.closeBtnState=this.closeBtn.getStyle("display");this.closeBtn.hide();if(this.stickBtn){this.stickBtn.show()}this.el.show();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.beforeSlide();this.el.setStyle("z-index",10001);this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.get(document).on("click",this.slideInIf,this);this.fireEvent("slideshow",this)},scope:this,block:true})},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");if(this.collapseBtn){this.collapseBtn.show()}this.closeBtn.setStyle("display",this.closeBtnState);if(this.stickBtn){this.stickBtn.hide()}this.fireEvent("slidehide",this)},slideIn:function(A){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(A);return }this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);this.afterSlide();this.afterSlideIn();Ext.callback(A)},scope:this,block:true})},slideInIf:function(A){if(!A.within(this.el)){this.slideIn()}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var A=this.getSlideAnchor();this.el.slideOut(A,{callback:function(){this.el.setStyle("z-index","");this.collapsedEl.slideIn(A,{duration:0.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this)},scope:this,block:true})},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:0.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show()}this.fireEvent("invalidated",this);this.fireEvent("expanded",this)},scope:this,block:true})},anchors:{"west":"left","east":"right","north":"top","south":"bottom"},sanchors:{"west":"l","east":"r","north":"t","south":"b"},canchors:{"west":"tl-tr","east":"tr-tl","north":"tl-bl","south":"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var A=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var B=this.collapsedEl,A=this.cmargins;switch(this.position){case"west":return[-(A.right+B.getWidth()+A.left),0];break;case"east":return[A.right+B.getWidth()+A.left,0];break;case"north":return[0,-(A.top+A.bottom+B.getHeight())];break;case"south":return[0,A.top+A.bottom+B.getHeight()];break}}});Ext.CenterLayoutRegion=function(B,A){Ext.CenterLayoutRegion.superclass.constructor.call(this,B,A,"center");this.visible=true;this.minWidth=A.minWidth||20;this.minHeight=A.minHeight||20};Ext.extend(Ext.CenterLayoutRegion,Ext.LayoutRegion,{hide:function(){},show:function(){},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight}});Ext.NorthLayoutRegion=function(C,B){Ext.NorthLayoutRegion.superclass.constructor.call(this,C,B,"north","n-resize");if(this.split){this.split.placement=Ext.SplitBar.TOP;this.split.orientation=Ext.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v")}var A=B.initialSize||B.height;if(typeof A!="undefined"){this.el.setHeight(A)}};Ext.extend(Ext.NorthLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox()}var A=this.el.getBox();if(this.split){A.height+=this.split.el.getHeight()}return A},updateBox:function(A){if(this.split&&!this.collapsed){A.height-=this.split.el.getHeight();this.split.el.setLeft(A.x);this.split.el.setTop(A.y+A.height);this.split.el.setWidth(A.width)}if(this.collapsed){this.updateBody(A.width,null)}Ext.NorthLayoutRegion.superclass.updateBox.call(this,A)}});Ext.SouthLayoutRegion=function(B,A){Ext.SouthLayoutRegion.superclass.constructor.call(this,B,A,"south","s-resize");if(this.split){this.split.placement=Ext.SplitBar.BOTTOM;this.split.orientation=Ext.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v")}var C=A.initialSize||A.height;if(typeof C!="undefined"){this.el.setHeight(C)}};Ext.extend(Ext.SouthLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox()}var A=this.el.getBox();if(this.split){var B=this.split.el.getHeight();A.height+=B;A.y-=B}return A},updateBox:function(A){if(this.split&&!this.collapsed){var B=this.split.el.getHeight();A.height-=B;A.y+=B;this.split.el.setLeft(A.x);this.split.el.setTop(A.y-B);this.split.el.setWidth(A.width)}if(this.collapsed){this.updateBody(A.width,null)}Ext.SouthLayoutRegion.superclass.updateBox.call(this,A)}});Ext.EastLayoutRegion=function(C,B){Ext.EastLayoutRegion.superclass.constructor.call(this,C,B,"east","e-resize");if(this.split){this.split.placement=Ext.SplitBar.RIGHT;this.split.orientation=Ext.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h")}var A=B.initialSize||B.width;if(typeof A!="undefined"){this.el.setWidth(A)}};Ext.extend(Ext.EastLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox()}var B=this.el.getBox();if(this.split){var A=this.split.el.getWidth();B.width+=A;B.x-=A}return B},updateBox:function(B){if(this.split&&!this.collapsed){var A=this.split.el.getWidth();B.width-=A;this.split.el.setLeft(B.x);this.split.el.setTop(B.y);this.split.el.setHeight(B.height);B.x+=A}if(this.collapsed){this.updateBody(null,B.height)}Ext.EastLayoutRegion.superclass.updateBox.call(this,B)}});Ext.WestLayoutRegion=function(C,B){Ext.WestLayoutRegion.superclass.constructor.call(this,C,B,"west","w-resize");if(this.split){this.split.placement=Ext.SplitBar.LEFT;this.split.orientation=Ext.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h")}var A=B.initialSize||B.width;if(typeof A!="undefined"){this.el.setWidth(A)}};Ext.extend(Ext.WestLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox()}var A=this.el.getBox();if(this.split){A.width+=this.split.el.getWidth()}return A},updateBox:function(B){if(this.split&&!this.collapsed){var A=this.split.el.getWidth();B.width-=A;this.split.el.setLeft(B.x+B.width);this.split.el.setTop(B.y);this.split.el.setHeight(B.height)}if(this.collapsed){this.updateBody(null,B.height)}Ext.WestLayoutRegion.superclass.updateBox.call(this,B)}});Ext.LayoutStateManager=function(A){this.state={north:{},south:{},east:{},west:{}}};Ext.LayoutStateManager.prototype={init:function(G,F){this.provider=F;var D=F.get(G.id+"-layout-state");if(D){var C=G.isUpdating();if(!C){G.beginUpdate()}for(var B in D){if(typeof D[B]!="function"){var A=D[B];var E=G.getRegion(B);if(E&&A){if(A.size){E.resizeTo(A.size)}if(A.collapsed==true){E.collapse(true)}else{E.expand(null,true)}}}}if(!C){G.endUpdate()}this.state=D}this.layout=G;G.on("regionresized",this.onRegionResized,this);G.on("regioncollapsed",this.onRegionCollapsed,this);G.on("regionexpanded",this.onRegionExpanded,this)},storeState:function(){this.provider.set(this.layout.id+"-layout-state",this.state)},onRegionResized:function(A,B){this.state[A.getPosition()].size=B;this.storeState()},onRegionCollapsed:function(A){this.state[A.getPosition()].collapsed=true;this.storeState()},onRegionExpanded:function(A){this.state[A.getPosition()].collapsed=false;this.storeState()}};Ext.ContentPanel=function(A,C,B){if(A.autoCreate){C=A;A=Ext.id()}this.el=Ext.get(A);if(!this.el&&C&&C.autoCreate){if(typeof C.autoCreate=="object"){if(!C.autoCreate.id){C.autoCreate.id=C.id||A}this.el=Ext.DomHelper.append(document.body,C.autoCreate,true)}else{this.el=Ext.DomHelper.append(document.body,{tag:"div",cls:"x-layout-inactive-content",id:C.id||A},true)}}this.closable=false;this.loaded=false;this.active=false;if(typeof C=="string"){this.title=C}else{Ext.apply(this,C)}if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl,true)}else{this.resizeEl=this.el}this.addEvents({"activate":true,"deactivate":true,"resize":true});if(this.autoScroll){this.resizeEl.setStyle("overflow","auto")}B=B||this.content;if(B){this.setContent(B)}if(C&&C.url){this.setUrl(this.url,this.params,this.loadOnce)}Ext.ContentPanel.superclass.constructor.call(this)};Ext.extend(Ext.ContentPanel,Ext.util.Observable,{tabTip:"",setRegion:function(A){this.region=A;if(A){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content")}else{this.el.replaceClass("x-layout-active-content","x-layout-inactive-content")}},getToolbar:function(){return this.toolbar},setActiveState:function(A){this.active=A;if(!A){this.fireEvent("deactivate",this)}else{this.fireEvent("activate",this)}},setContent:function(B,A){this.el.update(B,A)},ignoreResize:function(A,B){if(this.lastSize&&this.lastSize.width==A&&this.lastSize.height==B){return true}else{this.lastSize={width:A,height:B};return false}},getUpdateManager:function(){return this.el.getUpdateManager()},load:function(){var A=this.el.getUpdateManager();A.update.apply(A,arguments);return this},setUrl:function(C,B,A){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate)}this.refreshDelegate=this._handleRefresh.createDelegate(this,[C,B,A]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager()},_handleRefresh:function(A,D,C){if(!C||!this.loaded){var B=this.el.getUpdateManager();B.update(A,D,this._setLoaded.createDelegate(this))}},_setLoaded:function(){this.loaded=true},getId:function(){return this.el.id},getEl:function(){return this.el},adjustForComponents:function(B,A){if(this.resizeEl!=this.el){B-=this.el.getFrameWidth("lr");A-=this.el.getFrameWidth("tb")}if(this.toolbar){var C=this.toolbar.getEl();A-=C.getHeight();C.setWidth(B)}if(this.adjustments){B+=this.adjustments[0];A+=this.adjustments[1]}return{"width":B,"height":A}},setSize:function(C,B){if(this.fitToFrame&&!this.ignoreResize(C,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(C,B)}var A=this.adjustForComponents(C,B);this.resizeEl.setSize(this.autoWidth?"auto":A.width,this.autoHeight?"auto":A.height);this.fireEvent("resize",this,A.width,A.height)}},getTitle:function(){return this.title},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A)}},isClosable:function(){return this.closable},beforeSlide:function(){this.el.clip();this.resizeEl.clip()},afterSlide:function(){this.el.unclip();this.resizeEl.unclip()},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate()}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null}});Ext.GridPanel=function(B,A){this.wrapper=Ext.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(B.getGridEl().dom);Ext.GridPanel.superclass.constructor.call(this,this.wrapper,A);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild)}B.monitorWindowResize=false;B.autoHeight=false;B.autoWidth=false;this.grid=B;this.grid.getGridEl().replaceClass("x-layout-inactive-content","x-layout-component-panel")};Ext.extend(Ext.GridPanel,Ext.ContentPanel,{getId:function(){return this.grid.id},getGrid:function(){return this.grid},setSize:function(D,C){if(!this.ignoreResize(D,C)){var B=this.grid;var A=this.adjustForComponents(D,C);B.getGridEl().setSize(A.width,A.height);B.autoSize()}},beforeSlide:function(){this.grid.getView().scroller.clip()},afterSlide:function(){this.grid.getView().scroller.unclip()},destroy:function(){this.grid.destroy();delete this.grid;Ext.GridPanel.superclass.destroy.call(this)}});Ext.NestedLayoutPanel=function(B,A){Ext.NestedLayoutPanel.superclass.constructor.call(this,B.getEl(),A);B.monitorWindowResize=false;this.layout=B;this.layout.getEl().addClass("x-layout-nested-layout")};Ext.extend(Ext.NestedLayoutPanel,Ext.ContentPanel,{setSize:function(E,D){if(!this.ignoreResize(E,D)){var C=this.adjustForComponents(E,D);var A=this.layout.getEl();A.setSize(C.width,C.height);var B=A.dom.offsetWidth;this.layout.layout();if(Ext.isIE&&!this.initialized){this.initialized=true;this.layout.layout()}}},getLayout:function(){return this.layout}});Ext.ScrollPanel=function(E,C,B){C=C||{};C.fitToFrame=true;Ext.ScrollPanel.superclass.constructor.call(this,E,C,B);this.el.dom.style.overflow="hidden";var F=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var A=F.createChild({cls:"x-scroller-up",html:"&#160;"},this.el.dom);var D=F.createChild({cls:"x-scroller-down",html:"&#160;"});A.unselectable();D.unselectable();A.on("click",this.scrollUp,this);D.on("click",this.scrollDown,this);A.addClassOnOver("x-scroller-btn-over");D.addClassOnOver("x-scroller-btn-over");A.addClassOnClick("x-scroller-btn-click");D.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(A.getHeight()+D.getHeight())];this.resizeEl=this.el;this.el=F;this.up=A;this.down=D};Ext.extend(Ext.ScrollPanel,Ext.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this})},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this})},afterScroll:function(){var D=this.resizeEl;var A=D.dom.scrollTop,C=D.dom.scrollHeight,B=D.dom.clientHeight;this.up[A==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[C-A<=B?"addClass":"removeClass"]("x-scroller-btn-disabled")},setSize:function(){Ext.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll()},onWheel:function(A){var B=A.getWheelDelta();this.resizeEl.dom.scrollTop-=(B*this.wheelIncrement);this.afterScroll();A.stopEvent()},setContent:function(A,B){this.resizeEl.update(A,B)}});Ext.ReaderLayout=function(C,B){var D=C||{size:{}};Ext.ReaderLayout.superclass.constructor.call(this,B||document.body,{north:D.north!==false?Ext.apply({split:false,initialSize:32,titlebar:false},D.north):false,west:D.west!==false?Ext.apply({split:true,initialSize:200,minSize:175,maxSize:400,titlebar:true,collapsible:true,animate:true,margins:{left:5,right:0,bottom:5,top:5},cmargins:{left:5,right:5,bottom:5,top:5}},D.west):false,east:D.east!==false?Ext.apply({split:true,initialSize:200,minSize:175,maxSize:400,titlebar:true,collapsible:true,animate:true,margins:{left:0,right:5,bottom:5,top:5},cmargins:{left:5,right:5,bottom:5,top:5}},D.east):false,center:Ext.apply({tabPosition:"top",autoScroll:false,closeOnTab:true,titlebar:false,margins:{left:D.west!==false?0:5,right:D.east!==false?0:5,bottom:5,top:2}},D.center)});this.el.addClass("x-reader");this.beginUpdate();var A=new Ext.BorderLayout(Ext.get(document.body).createChild(),{south:D.preview!==false?Ext.apply({split:true,initialSize:200,minSize:100,autoScroll:true,collapsible:true,titlebar:true,cmargins:{top:5,left:0,right:0,bottom:0}},D.preview):false,center:Ext.apply({autoScroll:false,titlebar:false,minHeight:200},D.listView)});this.add("center",new Ext.NestedLayoutPanel(A,Ext.apply({title:D.mainTitle||"",tabTip:""},D.innerPanelCfg)));this.endUpdate();this.regions.preview=A.getRegion("south");this.regions.listView=A.getRegion("center")};Ext.extend(Ext.ReaderLayout,Ext.BorderLayout);Ext.grid.Grid=function(B,A){this.container=Ext.get(B);this.container.update("");this.container.setStyle("overflow","hidden");this.container.addClass("x-grid-container");this.id=this.container.id;Ext.apply(this,A);if(this.ds){this.dataSource=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}if(this.width){this.container.setWidth(this.width)}if(this.height){this.container.setHeight(this.height)}this.addEvents({"click":true,"dblclick":true,"contextmenu":true,"mousedown":true,"mouseup":true,"mouseover":true,"mouseout":true,"keypress":true,"keydown":true,"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"headerclick":true,"headerdblclick":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"bodyscroll":true,"columnresize":true,"columnmove":true,"startdrag":true,"enddrag":true,"dragdrop":true,"dragover":true,"dragenter":true,"dragout":true,render:true});Ext.grid.Grid.superclass.constructor.call(this)};Ext.extend(Ext.grid.Grid,Ext.util.Observable,{minColumnWidth:25,autoSizeColumns:false,autoSizeHeaders:true,monitorWindowResize:true,maxRowsToMeasure:0,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableColumnHide:true,enableRowHeightSync:false,stripeRows:true,autoHeight:false,autoExpandColumn:false,autoExpandMin:50,autoExpandMax:1000,view:null,loadMask:false,rendered:false,render:function(){var B=this.container;if((!B.dom.offsetHeight||B.dom.offsetHeight<20)||B.getStyle("height")=="auto"){this.autoHeight=true}var A=this.getView();A.init(this);B.on("click",this.onClick,this);B.on("dblclick",this.onDblClick,this);B.on("contextmenu",this.onContextMenu,this);B.on("keydown",this.onKeyDown,this);this.relayEvents(B,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);A.render();if(this.loadMask){this.loadMask=new Ext.LoadMask(this.container,Ext.apply({store:this.dataSource},this.loadMask))}this.rendered=true;this.fireEvent("render",this);return this},reconfigure:function(B,A){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.container,Ext.apply({store:B},this.loadMask))}this.view.bind(B,A);this.dataSource=B;this.colModel=A;this.view.refresh(true)},onKeyDown:function(A){this.fireEvent("keydown",A)},destroy:function(B,A){if(this.loadMask){this.loadMask.destroy()}var C=this.container;C.removeAllListeners();this.view.destroy();this.colModel.purgeListeners();if(!A){this.purgeListeners()}C.update("");if(B===true){C.remove()}},processEvent:function(B,D){this.fireEvent(B,D);var C=D.getTarget();var A=this.view;var G=A.findHeaderIndex(C);if(G!==false){this.fireEvent("header"+B,this,G,D)}else{var F=A.findRowIndex(C);var E=A.findCellIndex(C);if(F!==false){this.fireEvent("row"+B,this,F,D);if(E!==false){this.fireEvent("cell"+B,this,F,E,D)}}}},onClick:function(A){this.processEvent("click",A)},onContextMenu:function(B,A){this.processEvent("contextmenu",B)},onDblClick:function(A){this.processEvent("dblclick",A)},walkCells:function(J,E,B,H,G){var I=this.colModel,F=I.getColumnCount();var D=this.dataSource,C=D.getCount(),A=true;if(B<0){if(E<0){J--;A=false}while(J>=0){if(!A){E=F-1}A=false;while(E>=0){if(H.call(G||this,J,E,I)===true){return[J,E]}E--}J--}}else{if(E>=F){J++;A=false}while(J<C){if(!A){E=0}A=false;while(E<F){if(H.call(G||this,J,E,I)===true){return[J,E]}E++}J++}}return null},getSelections:function(){return this.selModel.getSelections()},autoSize:function(){if(this.rendered){this.view.layout();if(this.view.adjustForScroll){this.view.adjustForScroll()}}},getGridEl:function(){return this.container},stopEditing:function(){},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel()}return this.selModel},getDataSource:function(){return this.dataSource},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var A=this.selModel.getCount();return String.format(this.ddText,A,A==1?"":"s")}});Ext.grid.Grid.prototype.ddText="{0} selected row{1}";Ext.grid.AbstractGridView=function(){this.grid=null;this.events={"beforerowremoved":true,"beforerowsinserted":true,"beforerefresh":true,"rowremoved":true,"rowsinserted":true,"rowupdated":true,"refresh":true};Ext.grid.AbstractGridView.superclass.constructor.call(this)};Ext.extend(Ext.grid.AbstractGridView,Ext.util.Observable,{rowClass:"x-grid-row",cellClass:"x-grid-cell",tdClass:"x-grid-td",hdClass:"x-grid-hd",splitClass:"x-grid-hd-split",init:function(B){this.grid=B;var A=this.grid.getGridEl().id;this.colSelector="#"+A+" ."+this.cellClass+"-";this.tdSelector="#"+A+" ."+this.tdClass+"-";this.hdSelector="#"+A+" ."+this.hdClass+"-";this.splitSelector="#"+A+" ."+this.splitClass+"-"},getColumnRenderers:function(){var D=[];var A=this.grid.colModel;var C=A.getColumnCount();for(var B=0;B<C;B++){D[B]=A.getRenderer(B)}return D},getColumnIds:function(){var C=[];var B=this.grid.colModel;var A=B.getColumnCount();for(var D=0;D<A;D++){C[D]=B.getColumnId(D)}return C},getDataIndexes:function(){if(!this.indexMap){this.indexMap=this.buildIndexMap()}return this.indexMap.colToData},getColumnIndexByDataIndex:function(A){if(!this.indexMap){this.indexMap=this.buildIndexMap()}return this.indexMap.dataToCol[A]},setCSSStyle:function(C,B,A){var D="#"+this.grid.id+" .x-grid-col-"+C;Ext.util.CSS.updateRule(D,B,A)},generateRules:function(B){var E=[],D=this.grid.id+"-cssrules";Ext.util.CSS.removeStyleSheet(D);for(var C=0,A=B.getColumnCount();C<A;C++){var F=B.getColumnId(C);E.push(this.colSelector,F," {\n",B.config[C].css,"}\n",this.tdSelector,F," {\n}\n",this.hdSelector,F," {\n}\n",this.splitSelector,F," {\n}\n")}return Ext.util.CSS.createStyleSheet(E.join(""),D)}});Ext.grid.GridView=function(A){Ext.grid.GridView.superclass.constructor.call(this);this.el=null;Ext.apply(this,A)};Ext.extend(Ext.grid.GridView,Ext.grid.AbstractGridView,{rowClass:"x-grid-row",cellClass:"x-grid-col",tdClass:"x-grid-td",hdClass:"x-grid-hd",splitClass:"x-grid-split",sortClasses:["sort-asc","sort-desc"],enableMoveAnim:false,hlColor:"C3DAF9",dh:Ext.DomHelper,fly:Ext.Element.fly,css:Ext.util.CSS,borderWidth:1,splitOffset:3,scrollIncrement:22,cellRE:/(?:.*?)x-grid-(?:hd|cell|csplit)-(?:[\d]+)-([\d]+)(?:.*?)/,findRE:/\s?(?:x-grid-hd|x-grid-col|x-grid-csplit)\s/,bind:function(B,A){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this)}if(B){B.on("load",this.onLoad,this);B.on("datachanged",this.onDataChange,this);B.on("add",this.onAdd,this);B.on("remove",this.onRemove,this);B.on("update",this.onUpdate,this);B.on("clear",this.onClear,this)}this.ds=B;if(this.cm){this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this);this.cm.un("columnlockchange",this.onColumnLock,this)}if(A){this.generateRules(A);A.on("widthchange",this.onColWidthChange,this);A.on("headerchange",this.onHeaderChange,this);A.on("hiddenchange",this.onHiddenChange,this);A.on("columnmoved",this.onColumnMove,this);A.on("columnlockchange",this.onColumnLock,this)}this.cm=A},init:function(B){Ext.grid.GridView.superclass.init.call(this,B);this.bind(B.dataSource,B.colModel);B.on("headerclick",this.handleHeaderClick,this);if(B.trackMouseOver){B.on("mouseover",this.onRowOver,this);B.on("mouseout",this.onRowOut,this)}B.cancelTextSelection=function(){};this.gridId=B.id;var A=this.templates||{};if(!A.master){A.master=new Ext.Template('<div class="x-grid" hidefocus="true">','<div class="x-grid-topbar"></div>','<div class="x-grid-scroller"><div></div></div>','<div class="x-grid-locked">','<div class="x-grid-header">{lockedHeader}</div>','<div class="x-grid-body">{lockedBody}</div>',"</div>",'<div class="x-grid-viewport">','<div class="x-grid-header">{header}</div>','<div class="x-grid-body">{body}</div>',"</div>",'<div class="x-grid-bottombar"></div>','<a href="#" class="x-grid-focus" tabIndex="-1"></a>','<div class="x-grid-resize-proxy">&#160;</div>',"</div>");A.master.disableformats=true}if(!A.header){A.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0">','<tbody><tr class="x-grid-hd-row">{cells}</tr></tbody>',"</table>{splits}");A.header.disableformats=true}A.header.compile();if(!A.hcell){A.hcell=new Ext.Template('<td class="x-grid-hd x-grid-td-{id} {cellId}"><div title="{title}" class="x-grid-hd-inner x-grid-hd-{id}">','<div class="x-grid-hd-text" unselectable="on">{value}<img class="x-grid-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" /></div>',"</div></td>");A.hcell.disableFormats=true}A.hcell.compile();if(!A.hsplit){A.hsplit=new Ext.Template('<div class="x-grid-split {splitId} x-grid-split-{id}" style="{style}" unselectable="on">&#160;</div>');A.hsplit.disableFormats=true}A.hsplit.compile();if(!A.body){A.body=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0">',"<tbody>{rows}</tbody>","</table>");A.body.disableFormats=true}A.body.compile();if(!A.row){A.row=new Ext.Template('<tr class="x-grid-row {alt}">{cells}</tr>');A.row.disableFormats=true}A.row.compile();if(!A.cell){A.cell=new Ext.Template('<td class="x-grid-col x-grid-td-{id} {cellId} {css}" tabIndex="0">','<div class="x-grid-col-{id} x-grid-cell-inner"><div class="x-grid-cell-text" unselectable="on" {attr}>{value}</div></div>',"</td>");A.cell.disableFormats=true}A.cell.compile();this.templates=A},onColWidthChange:function(){this.updateColumns.apply(this,arguments)},onHeaderChange:function(){this.updateHeaders.apply(this,arguments)},onHiddenChange:function(){this.handleHiddenChange.apply(this,arguments)},onColumnMove:function(){this.handleColumnMove.apply(this,arguments)},onColumnLock:function(){this.handleLockChange.apply(this,arguments)},onDataChange:function(){this.refresh();this.updateHeaderSortState()},onClear:function(){this.refresh()},onUpdate:function(B,A){this.refreshRow(A)},refreshRow:function(A){var C=this.ds,B;if(typeof A=="number"){B=A;A=C.getAt(B)}else{B=C.indexOf(A)}this.insertRows(C,B,B,true);this.onRemove(C,A,B+1,true);this.syncRowHeights(B,B);this.layout();this.fireEvent("rowupdated",this,B,A)},onAdd:function(C,B,A){this.insertRows(C,A,A+(B.length-1))},onRemove:function(C,F,E,D){if(D!==true){this.fireEvent("beforerowremoved",this,E,F)}var B=this.getBodyTable(),A=this.getLockedTable();if(B.rows[E]){B.firstChild.removeChild(B.rows[E])}if(A.rows[E]){A.firstChild.removeChild(A.rows[E])}if(D!==true){this.stripeRows(E);this.syncRowHeights(E,E);this.layout();this.fireEvent("rowremoved",this,E,F)}},onLoad:function(){this.scrollToTop()},scrollToTop:function(){if(this.scroller){this.scroller.dom.scrollTop=0;this.syncScroll()}},getHeaderPanel:function(A){if(A){this.headerPanel.show()}return this.headerPanel},getFooterPanel:function(A){if(A){this.footerPanel.show()}return this.footerPanel},initElements:function(){var C=Ext.Element;var B=this.grid.getGridEl().dom.firstChild;var A=B.childNodes;this.el=new C(B);this.headerPanel=new C(B.firstChild);this.headerPanel.enableDisplayMode("block");this.scroller=new C(A[1]);this.scrollSizer=new C(this.scroller.dom.firstChild);this.lockedWrap=new C(A[2]);this.lockedHd=new C(this.lockedWrap.dom.firstChild);this.lockedBody=new C(this.lockedWrap.dom.childNodes[1]);this.mainWrap=new C(A[3]);this.mainHd=new C(this.mainWrap.dom.firstChild);this.mainBody=new C(this.mainWrap.dom.childNodes[1]);this.footerPanel=new C(A[4]);this.footerPanel.enableDisplayMode("block");this.focusEl=new C(A[5]);this.focusEl.swallowEvent("click",true);this.resizeProxy=new C(A[6]);this.headerSelector=String.format("#{0} td.x-grid-hd, #{1} td.x-grid-hd",this.lockedHd.id,this.mainHd.id);this.splitterSelector=String.format("#{0} div.x-grid-split, #{1} div.x-grid-split",this.lockedHd.id,this.mainHd.id)},getHeaderCell:function(A){return Ext.DomQuery.select(this.headerSelector)[A]},getHeaderCellMeasure:function(A){return this.getHeaderCell(A).firstChild},getHeaderCellText:function(A){return this.getHeaderCell(A).firstChild.firstChild},getLockedTable:function(){return this.lockedBody.dom.firstChild},getBodyTable:function(){return this.mainBody.dom.firstChild},getLockedRow:function(A){return this.getLockedTable().rows[A]},getRow:function(A){return this.getBodyTable().rows[A]},getRowComposite:function(C){if(!this.rowEl){this.rowEl=new Ext.CompositeElementLite()}var D=[],B,A;if(B=this.getLockedRow(C)){D.push(B)}if(A=this.getRow(C)){D.push(A)}this.rowEl.elements=D;return this.rowEl},getCell:function(D,C){var B=this.cm.getLockedCount();var A;if(C<B){A=this.lockedBody.dom.firstChild}else{A=this.mainBody.dom.firstChild;C-=B}return A.rows[D].childNodes[C]},getCellText:function(B,A){return this.getCell(B,A).firstChild.firstChild},getCellBox:function(B){var A=this.fly(B).getBox();if(Ext.isOpera){A.y=B.offsetTop+this.mainBody.getY()}return A},getCellIndex:function(A){var B=String(A.className).match(this.cellRE);if(B){return parseInt(B[1],10)}return 0},findHeaderIndex:function(B){var A=Ext.fly(B).findParent("td."+this.hdClass,6);return A?this.getCellIndex(A):false},findHeaderCell:function(B){var A=Ext.fly(B).findParent("td."+this.hdClass,6);return A?A:false},findRowIndex:function(B){if(!B){return false}var A=Ext.fly(B).findParent("tr."+this.rowClass,6);return A?A.rowIndex:false},findCellIndex:function(B){var A=this.el.dom;while(B&&B!=A){if(this.findRE.test(B.className)){return this.getCellIndex(B)}B=B.parentNode}return false},getColumnId:function(A){return this.cm.getColumnId(A)},getSplitters:function(){if(this.splitterSelector){return Ext.DomQuery.select(this.splitterSelector)}else{return null}},getSplitter:function(A){return this.getSplitters()[A]},onRowOver:function(B,A){var C;if((C=this.findRowIndex(A))!==false){this.getRowComposite(C).addClass("x-grid-row-over")}},onRowOut:function(B,A){var C;if((C=this.findRowIndex(A))!==false&&C!==this.findRowIndex(B.getRelatedTarget())){this.getRowComposite(C).removeClass("x-grid-row-over")}},renderHeaders:function(){var J=this.cm;var F=this.templates.hcell,I=this.templates.header,K=this.templates.hsplit;var D=[],B=[],H=[],C=[],A={};for(var E=0,G=J.getColumnCount();E<G;E++){A.cellId="x-grid-hd-0-"+E;A.splitId="x-grid-csplit-0-"+E;A.id=J.getColumnId(E);A.title=J.getColumnTooltip(E)||"";A.value=J.getColumnHeader(E)||"";A.style=(this.grid.enableColumnResize===false||!J.isResizable(E)||J.isFixed(E))?"cursor:default":"";if(!J.isLocked(E)){D[D.length]=F.apply(A);H[H.length]=K.apply(A)}else{B[B.length]=F.apply(A);C[C.length]=K.apply(A)}}return[I.apply({cells:B.join(""),splits:C.join("")}),I.apply({cells:D.join(""),splits:H.join("")})]},updateHeaders:function(){var A=this.renderHeaders();this.lockedHd.update(A[0]);this.mainHd.update(A[1])},focusRow:function(B){var A=this.scroller.dom.scrollLeft;this.focusCell(B,0,false);this.scroller.dom.scrollLeft=A},focusCell:function(D,A,C){var B=this.ensureVisible(D,A,C);this.focusEl.alignTo(B,"tl-tl");if(Ext.isGecko){this.focusEl.focus()}else{this.focusEl.focus.defer(1,this.focusEl)}},ensureVisible:function(O,D,B){if(typeof O!="number"){O=O.rowIndex}if(O<0&&O>=this.ds.getCount()){return }D=(D!==undefined?D:0);var H=this.grid.colModel;while(H.isHidden(D)){D++}var C=this.getCell(O,D);if(!C){return }var E=this.scroller.dom;var M=parseInt(C.offsetTop,10);var K=parseInt(C.offsetLeft,10);var I=M+C.offsetHeight;var G=K+C.offsetWidth;var A=E.clientHeight-this.mainHd.dom.offsetHeight;var F=parseInt(E.scrollTop,10);var N=parseInt(E.scrollLeft,10);var L=F+A;var J=N+E.clientWidth;if(M<F){E.scrollTop=M}else{if(I>L){E.scrollTop=I-A}}if(B!==false){if(K<N){E.scrollLeft=K}else{if(G>J){E.scrollLeft=G-E.clientWidth}}}return C},updateColumns:function(){this.grid.stopEditing();var B=this.grid.colModel,E=this.getColumnIds();var F=0;for(var D=0,A=B.getColumnCount();D<A;D++){var C=B.getColumnWidth(D);this.css.updateRule(this.colSelector+E[D],"width",(C-this.borderWidth)+"px");this.css.updateRule(this.hdSelector+E[D],"width",(C-this.borderWidth)+"px")}this.updateSplitters()},generateRules:function(I){var F=[],C=this.grid.id+"-cssrules";Ext.util.CSS.removeStyleSheet(C);for(var B=0,D=I.getColumnCount();B<D;B++){var G=I.getColumnId(B);var A="";if(I.config[B].align){A="text-align:"+I.config[B].align+";"}var H="";if(I.isHidden(B)){H="display:none;"}var E="width:"+(I.getColumnWidth(B)-this.borderWidth)+"px;";F.push(this.colSelector,G," {\n",I.config[B].css,A,E,"\n}\n",this.hdSelector,G," {\n",A,E,"}\n",this.tdSelector,G," {\n",H,"\n}\n",this.splitSelector,G," {\n",H,"\n}\n")}return Ext.util.CSS.createStyleSheet(F.join(""),C)},updateSplitters:function(){var B=this.cm,E=this.getSplitters();if(E){var G=0,F=true;for(var D=0,A=B.getColumnCount();D<A;D++){if(B.isHidden(D)){continue}var C=B.getColumnWidth(D);if(!B.isLocked(D)&&F){G=0;F=false}G+=C;E[D].style.left=(G-this.splitOffset)+"px"}}},handleHiddenChange:function(C,B,A){if(A){this.hideColumn(B)}else{this.unhideColumn(B)}},hideColumn:function(A){var B=this.getColumnId(A);this.css.updateRule(this.tdSelector+B,"display","none");this.css.updateRule(this.splitSelector+B,"display","none");if(Ext.isSafari){this.updateHeaders()}this.updateSplitters();this.layout()},unhideColumn:function(A){var B=this.getColumnId(A);this.css.updateRule(this.tdSelector+B,"display","");this.css.updateRule(this.splitSelector+B,"display","");if(Ext.isSafari){this.updateHeaders()}this.updateSplitters();this.layout()},insertRows:function(B,F,D,C){if(F==0&&D==B.getCount()-1){this.refresh()}else{if(!C){this.fireEvent("beforerowsinserted",this,F,D)}var E=this.getScrollState();var A=this.renderRows(F,D);this.bufferRows(A[0],this.getLockedTable(),F);this.bufferRows(A[1],this.getBodyTable(),F);this.restoreScroll(E);if(!C){this.fireEvent("rowsinserted",this,F,D);this.syncRowHeights(F,D);this.stripeRows(F);this.layout()}}},bufferRows:function(B,A,J){var I=null,H=A.rows,G=A.tBodies[0];if(J<H.length){I=H[J]}var E=document.createElement("div");E.innerHTML="<table><tbody>"+B+"</tbody></table>";var F=E.firstChild.rows;for(var C=0,D=F.length;C<D;C++){if(I){G.insertBefore(F[0],I)}else{G.appendChild(F[0])}}E.innerHTML="";E=null},deleteRows:function(B,G,F){if(B.getRowCount()<1){this.fireEvent("beforerefresh",this);this.mainBody.update("");this.lockedBody.update("");this.fireEvent("refresh",this)}else{this.fireEvent("beforerowsdeleted",this,G,F);var A=this.getBodyTable();var E=A.firstChild;var C=A.rows;for(var D=G;D<=F;D++){E.removeChild(C[G])}this.stripeRows(G);this.fireEvent("rowsdeleted",this,G,F)}},updateRows:function(C,B,A){var D=this.getScrollState();this.refresh();this.restoreScroll(D)},handleSort:function(D,C,B,A){if(!A){this.refresh()}this.updateHeaderSortState()},getScrollState:function(){var A=this.scroller.dom;return{left:A.scrollLeft,top:A.scrollTop}},stripeRows:function(E){if(!this.grid.stripeRows||this.ds.getCount()<1){return }E=E||0;var C=this.getBodyTable().rows;var B=this.getLockedTable().rows;var I=" x-grid-row-alt ";for(var A=E,D=C.length;A<D;A++){var J=C[A],H=B[A];var G=((A+1)%2==0);var F=(" "+J.className+" ").indexOf(I)!=-1;if(G==F){continue}if(G){J.className+=" x-grid-row-alt"}else{J.className=J.className.replace("x-grid-row-alt","")}if(H){H.className=J.className}}},restoreScroll:function(A){var B=this.scroller.dom;B.scrollLeft=A.left;B.scrollTop=A.top;this.syncScroll()},syncScroll:function(){var D=this.scroller.dom;var B=this.mainHd.dom;var A=this.mainBody.dom;var C=this.lockedBody.dom;B.scrollLeft=A.scrollLeft=D.scrollLeft;C.scrollTop=A.scrollTop=D.scrollTop},handleScroll:function(A){this.syncScroll();var B=this.scroller.dom;this.grid.fireEvent("bodyscroll",B.scrollLeft,B.scrollTop);A.stopEvent()},handleWheel:function(A){var B=A.getWheelDelta();this.scroller.dom.scrollTop-=B*22;this.lockedBody.dom.scrollTop=this.mainBody.dom.scrollTop=this.scroller.dom.scrollTop;A.stopEvent()},renderRows:function(H,G){var I=this.grid,K=I.colModel,B=I.dataSource,E=I.stripeRows;var C=K.getColumnCount();if(B.getCount()<1){return["",""]}var J=[];for(var F=0;F<C;F++){var A=K.getDataIndex(F);J[F]={name:typeof A=="undefined"?B.fields.get(F).name:A,renderer:K.getRenderer(F),id:K.getColumnId(F),locked:K.isLocked(F)}}H=H||0;G=typeof G=="undefined"?B.getCount()-1:G;var D=B.getRange(H,G);return this.doRender(J,D,B,H,C,E)},doRender:Ext.isGecko?function(F,I,L,T,S,Q){var A=this.templates,E=A.cell,G=A.row;var U="",C="",M,H,V,N={},J={},K,D;for(var O=0,R=I.length;O<R;O++){K=I[O];M="";H="";D=(O+T);for(var P=0;P<S;P++){V=F[P];N.cellId="x-grid-cell-"+D+"-"+P;N.id=V.id;N.css=N.attr="";N.value=V.renderer(K.data[V.name],N,K,D,P,L);if(N.value==undefined||N.value===""){N.value="&#160;"}if(K.dirty&&typeof K.modified[V.name]!=="undefined"){N.css+=N.css?" x-grid-dirty-cell":"x-grid-dirty-cell"}var B=E.apply(N);if(!V.locked){M+=B}else{H+=B}}var W=[];if(Q&&((D+1)%2==0)){W[0]="x-grid-row-alt"}if(K.dirty){W[1]=" x-grid-dirty-row"}J.cells=H;if(this.getRowClass){W[2]=this.getRowClass(K,D)}J.alt=W.join(" ");C+=G.apply(J);J.cells=M;U+=G.apply(J)}return[C,U]}:function(C,F,M,J,I,H){var A=this.templates,B=A.cell,D=A.row;var T=[],K=[],N,E,V,O={},G={},L,U;for(var P=0,R=F.length;P<R;P++){L=F[P];N=[];E=[];U=(P+J);for(var Q=0;Q<I;Q++){V=C[Q];O.cellId="x-grid-cell-"+U+"-"+Q;O.id=V.id;O.css=O.attr="";O.value=V.renderer(L.data[V.name],O,L,U,Q,M);if(O.value==undefined||O.value===""){O.value="&#160;"}if(L.dirty&&typeof L.modified[V.name]!=="undefined"){O.css+=O.css?" x-grid-dirty-cell":"x-grid-dirty-cell"}var S=B.apply(O);if(!V.locked){N[N.length]=S}else{E[E.length]=S}}var W=[];if(H&&((U+1)%2==0)){W[0]="x-grid-row-alt"}if(L.dirty){W[1]=" x-grid-dirty-row"}G.cells=E;if(this.getRowClass){W[2]=this.getRowClass(L,U)}G.alt=W.join(" ");G.cells=E.join("");K[K.length]=D.apply(G);G.cells=N.join("");T[T.length]=D.apply(G)}return[K.join(""),T.join("")]},renderBody:function(){var B=this.renderRows();var A=this.templates.body;return[A.apply({rows:B[0]}),A.apply({rows:B[1]})]},refresh:function(A){this.fireEvent("beforerefresh",this);this.grid.stopEditing();var B=this.renderBody();this.lockedBody.update(B[0]);this.mainBody.update(B[1]);if(A===true){this.updateHeaders();this.updateColumns();this.updateSplitters();this.updateHeaderSortState()}this.syncRowHeights();this.layout();this.fireEvent("refresh",this)},handleColumnMove:function(A,D,C){this.indexMap=null;var B=this.getScrollState();this.refresh(true);this.restoreScroll(B);this.afterMove(C)},afterMove:function(A){if(this.enableMoveAnim&&Ext.enableFx){this.fly(this.getHeaderCell(A).firstChild).highlight(this.hlColor)}},updateCell:function(D,A,J){var I=this.getColumnIndexByDataIndex(J);if(typeof I=="undefined"){return }var F=this.grid.colModel;var H=this.getCell(A,I);var G=this.getCellText(A,I);var B={cellId:"x-grid-cell-"+A+"-"+I,id:F.getColumnId(I),css:I==F.getColumnCount()-1?"x-grid-col-last":""};var E=F.getRenderer(I);var C=E(D.getValueAt(A,J),B,A,I,D);if(typeof C=="undefined"||C===""){C="&#160;"}G.innerHTML=C;H.className=this.cellClass+" "+B.cellId+" "+B.css;this.syncRowHeights(A,A)},calcColumnWidth:function(I,H){var G=0;if(this.grid.autoSizeHeaders){var D=this.getHeaderCellMeasure(I);G=Math.max(G,D.scrollWidth)}var B,E;if(this.cm.isLocked(I)){B=this.getLockedTable();E=I}else{B=this.getBodyTable();E=I-this.cm.getLockedCount()}if(B&&B.rows){var J=B.rows;var A=Math.min(H||J.length,J.length);for(var C=0;C<A;C++){var F=J[C].childNodes[E].firstChild;G=Math.max(G,F.scrollWidth)}}return G+5},autoSizeColumn:function(C,B,A){if(this.cm.isHidden(C)){return }if(B){var E=this.cm.getColumnId(C);this.css.updateRule(this.colSelector+E,"width",this.grid.minColumnWidth+"px");if(this.grid.autoSizeHeaders){this.css.updateRule(this.hdSelector+E,"width",this.grid.minColumnWidth+"px")}}var D=this.calcColumnWidth(C);this.cm.setColumnWidth(C,Math.max(this.grid.minColumnWidth,D),A);if(!A){this.grid.fireEvent("columnresize",C,D)}},autoSizeColumns:function(){var A=this.grid.colModel;var B=A.getColumnCount();for(var C=0;C<B;C++){this.autoSizeColumn(C,true,true)}if(A.getTotalWidth()<this.scroller.dom.clientWidth){this.fitColumns()}else{this.updateColumns();this.layout()}},fitColumns:function(I){var H=this.grid.colModel;var F=H.getColumnCount();var D=[];var E=0;var B,G;for(B=0;B<F;B++){if(!H.isHidden(B)&&!H.isFixed(B)){G=H.getColumnWidth(B);D.push(B);D.push(G);E+=G}}var C=Math.min(this.scroller.dom.clientWidth,this.el.getWidth());if(I){C-=17}var A=(C-H.getTotalWidth())/E;while(D.length){G=D.pop();B=D.pop();H.setColumnWidth(B,Math.floor(G+G*A),true)}this.updateColumns();this.layout()},onRowSelect:function(A){var B=this.getRowComposite(A);B.addClass("x-grid-row-selected")},onRowDeselect:function(A){var B=this.getRowComposite(A);B.removeClass("x-grid-row-selected")},onCellSelect:function(C,B){var A=this.getCell(C,B);if(A){Ext.fly(A).addClass("x-grid-cell-selected")}},onCellDeselect:function(C,B){var A=this.getCell(C,B);if(A){Ext.fly(A).removeClass("x-grid-cell-selected")}},updateHeaderSortState:function(){var D=this.ds.getSortState();if(!D){return }this.sortState=D;var E=this.cm.findColumnIndex(D.field);if(E!=-1){var C=D.direction;var B=this.sortClasses;var A=this.el.select(this.headerSelector).removeClass(B);A.item(E).addClass(B[C=="DESC"?1:0])}},handleHeaderClick:function(D,C){if(this.headersDisabled){return }var B=D.dataSource,A=D.colModel;if(!A.isSortable(C)){return }D.stopEditing();B.sort(A.getDataIndex(C))},destroy:function(){if(this.colMenu){this.colMenu.removeAll();Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.getEl().remove();delete this.colMenu}if(this.hmenu){this.hmenu.removeAll();Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.getEl().remove();delete this.hmenu}if(this.grid.enableColumnMove){var C=Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id];if(C){for(var A in C){if(!C[A].config.isTarget&&C[A].dragElId){var B=C[A].dragElId;C[A].unreg();Ext.get(B).remove()}else{if(C[A].config.isTarget){C[A].proxyTop.remove();C[A].proxyBottom.remove();C[A].unreg()}}if(Ext.dd.DDM.locationCache[A]){delete Ext.dd.DDM.locationCache[A]}}delete Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id]}}Ext.util.CSS.removeStyleSheet(this.grid.id+"-cssrules");this.bind(null,null);Ext.EventManager.removeResizeListener(this.onWindowResize,this)},handleLockChange:function(){this.refresh(true)},onDenyColumnLock:function(){},onDenyColumnHide:function(){},handleHdMenuClick:function(D){var B=this.hdCtxIndex;var A=this.cm,E=this.ds;switch(D.id){case"asc":E.sort(A.getDataIndex(B),"ASC");break;case"desc":E.sort(A.getDataIndex(B),"DESC");break;case"lock":var C=A.getLockedCount();if(A.getColumnCount(true)<=C+1){this.onDenyColumnLock();return }if(C!=B){A.setLocked(B,true,true);A.moveColumn(B,C);this.grid.fireEvent("columnmove",B,C)}else{A.setLocked(B,true)}break;case"unlock":var C=A.getLockedCount();if((C-1)!=B){A.setLocked(B,false,true);A.moveColumn(B,C-1);this.grid.fireEvent("columnmove",B,C-1)}else{A.setLocked(B,false)}break;default:B=A.getIndexById(D.id.substr(4));if(B!=-1){if(D.checked&&A.getColumnCount(true)<=1){this.onDenyColumnHide();return false}A.setHidden(B,D.checked)}}return true},beforeColMenuShow:function(){var B=this.cm,A=B.getColumnCount();this.colMenu.removeAll();for(var C=0;C<A;C++){this.colMenu.add(new Ext.menu.CheckItem({id:"col-"+B.getColumnId(C),text:B.getColumnHeader(C),checked:!B.isHidden(C),hideOnClick:false}))}},handleHdCtx:function(C,F,E){E.stopEvent();var D=this.getHeaderCell(F);this.hdCtxIndex=F;var B=this.hmenu.items,A=this.cm;B.get("asc").setDisabled(!A.isSortable(F));B.get("desc").setDisabled(!A.isSortable(F));if(this.grid.enableColLock!==false){B.get("lock").setDisabled(A.isLocked(F));B.get("unlock").setDisabled(!A.isLocked(F))}this.hmenu.show(D,"tl-bl")},handleHdOver:function(B){var A=this.findHeaderCell(B.getTarget());if(A&&!this.headersDisabled){if(this.grid.colModel.isSortable(this.getCellIndex(A))){this.fly(A).addClass("x-grid-hd-over")}}},handleHdOut:function(B){var A=this.findHeaderCell(B.getTarget());if(A){this.fly(A).removeClass("x-grid-hd-over")}},handleSplitDblClick:function(C,B){var A=this.getCellIndex(B);if(this.grid.enableColumnResize!==false&&this.cm.isResizable(A)&&!this.cm.isFixed(A)){this.autoSizeColumn(A,true);this.layout()}},render:function(){var B=this.cm;var D=B.getColumnCount();if(this.grid.monitorWindowResize===true){Ext.EventManager.onWindowResize(this.onWindowResize,this,true)}var C=this.renderHeaders();var A=this.templates.body.apply({rows:""});var E=this.templates.master.apply({lockedBody:A,body:A,lockedHeader:C[0],header:C[1]});this.grid.getGridEl().dom.innerHTML=E;this.initElements();this.scroller.on("scroll",this.handleScroll,this);this.lockedBody.on("mousewheel",this.handleWheel,this);this.mainBody.on("mousewheel",this.handleWheel,this);this.mainHd.on("mouseover",this.handleHdOver,this);this.mainHd.on("mouseout",this.handleHdOut,this);this.mainHd.on("dblclick",this.handleSplitDblClick,this,{delegate:"."+this.splitClass});this.lockedHd.on("mouseover",this.handleHdOver,this);this.lockedHd.on("mouseout",this.handleHdOut,this);this.lockedHd.on("dblclick",this.handleSplitDblClick,this,{delegate:"."+this.splitClass});if(this.grid.enableColumnResize!==false&&Ext.grid.SplitDragZone){new Ext.grid.SplitDragZone(this.grid,this.lockedHd.dom,this.mainHd.dom)}this.updateSplitters();if(this.grid.enableColumnMove&&Ext.grid.HeaderDragZone){new Ext.grid.HeaderDragZone(this.grid,this.lockedHd.dom,this.mainHd.dom);new Ext.grid.HeaderDropZone(this.grid,this.lockedHd.dom,this.mainHd.dom)}if(this.grid.enableCtxMenu!==false&&Ext.menu.Menu){this.hmenu=new Ext.menu.Menu({id:this.grid.id+"-hctx"});this.hmenu.add({id:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{id:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(this.grid.enableColLock!==false){this.hmenu.add("-",{id:"lock",text:this.lockText,cls:"xg-hmenu-lock"},{id:"unlock",text:this.unlockText,cls:"xg-hmenu-unlock"})}if(this.grid.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:this.grid.id+"-hcols-menu"});this.colMenu.on("beforeshow",this.beforeColMenuShow,this);this.colMenu.on("itemclick",this.handleHdMenuClick,this);this.hmenu.add("-",{id:"columns",text:this.columnsText,menu:this.colMenu})}this.hmenu.on("itemclick",this.handleHdMenuClick,this);this.grid.on("headercontextmenu",this.handleHdCtx,this)}if((this.grid.enableDragDrop||this.grid.enableDrag)&&Ext.grid.GridDragZone){this.dd=new Ext.grid.GridDragZone(this.grid,{ddGroup:this.grid.ddGroup||"GridDD"})}this.updateHeaderSortState();this.beforeInitialResize();this.layout(true);this.renderPhase2.defer(1,this)},renderPhase2:function(){this.refresh();if(this.grid.autoSizeColumns){this.autoSizeColumns()}},beforeInitialResize:function(){},onColumnSplitterMoved:function(C,B){this.userResized=true;var A=this.grid.colModel;A.setColumnWidth(C,B,true);var D=A.getColumnId(C);this.css.updateRule(this.colSelector+D,"width",(B-this.borderWidth)+"px");this.css.updateRule(this.hdSelector+D,"width",(B-this.borderWidth)+"px");this.updateSplitters();this.layout();this.grid.fireEvent("columnresize",C,B)},syncRowHeights:function(B,H){if(this.grid.enableRowHeightSync===true&&this.cm.getLockedCount()>0){B=B||0;var G=this.getBodyTable().rows;var F=this.getLockedTable().rows;var I=G.length-1;H=Math.min(H||I,I);for(var D=B;D<=H;D++){var A=G[D],C=F[D];var E=Math.max(A.offsetHeight,C.offsetHeight);A.style.height=C.style.height=E+"px"}}},layout:function(H,E){var Z=this.grid;var I=Z.autoHeight;var D=16;var d=Z.getGridEl(),L=this.cm,B=Z.autoExpandColumn,S=this;if(!d.dom.offsetWidth){if(H){this.lockedWrap.show();this.mainWrap.show()}return }var F=this.cm.isLocked(0);var J=this.headerPanel.getHeight();var K=this.footerPanel.getHeight();if(I){var Q=this.getBodyTable().offsetHeight+J+K+this.mainHd.getHeight();var C=Q+d.getBorderWidth("tb");if(Z.maxHeight){C=Math.min(Z.maxHeight,C)}d.setHeight(C)}if(Z.autoWidth){d.setWidth(L.getTotalWidth()+d.getBorderWidth("lr"))}var R=this.scroller;var W=d.getSize(true);this.el.setSize(W.width,W.height);this.headerPanel.setWidth(W.width);this.footerPanel.setWidth(W.width);var V=this.mainHd.getHeight();var X=W.width;var e=W.height-(J+K);R.setSize(X,e);var a=this.getBodyTable();var P=F?Math.max(this.getLockedTable().offsetWidth,this.lockedHd.dom.firstChild.offsetWidth):0;var O=a.offsetHeight;var N=P+a.offsetWidth;var M=false,U=false;this.scrollSizer.setSize(N,O+V);var G=this.lockedWrap,T=this.mainWrap;var Y=this.lockedBody,A=this.mainBody;setTimeout(function(){var m=R.dom.offsetTop;var g=R.dom.clientWidth,o=R.dom.clientHeight;G.setTop(m);G.setSize(P,o);T.setLeftTop(P,m);T.setSize(g-P,o);Y.setHeight(o-V);A.setHeight(o-V);if(E!==true&&!S.userResized&&B){var l=L.getIndexById(B);var k=L.getTotalWidth(false);var n=L.getColumnWidth(l);var c=Math.min(Math.max(((g-k)+n-2)-(g<=R.dom.offsetWidth?0:18),Z.autoExpandMin),Z.autoExpandMax);if(n!=c){L.setColumnWidth(l,c,true);S.css.updateRule(S.colSelector+B,"width",(c-S.borderWidth)+"px");S.css.updateRule(S.hdSelector+B,"width",(c-S.borderWidth)+"px");S.updateSplitters();S.layout(false,true)}}if(H){G.show();T.show()}},10)},onWindowResize:function(){if(!this.grid.monitorWindowResize||this.grid.autoHeight){return }this.layout()},appendFooter:function(A){return null},sortAscText:"Sort Ascending",sortDescText:"Sort Descending",lockText:"Lock Column",unlockText:"Unlock Column",columnsText:"Columns"});Ext.grid.HeaderDragZone=function(C,B,A){this.grid=C;this.view=C.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,B);if(A){this.setHandleElId(Ext.id(B));this.setOuterHandleElId(Ext.id(A))}this.scroll=false};Ext.extend(Ext.grid.HeaderDragZone,Ext.dd.DragZone,{maxDragWidth:120,getDragData:function(C){var A=Ext.lib.Event.getTarget(C);var B=this.view.findHeaderCell(A);if(B){return{ddel:B.firstChild,header:B}}return false},onInitDrag:function(B){this.view.headersDisabled=true;var A=this.dragData.ddel.cloneNode(true);A.id=Ext.id();A.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(A);return true},afterValidDrop:function(){var A=this.view;setTimeout(function(){A.headersDisabled=false},50)},afterInvalidDrop:function(){var A=this.view;setTimeout(function(){A.headersDisabled=false},50)}});Ext.grid.HeaderDropZone=function(B,C,A){this.grid=B;this.view=B.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,B.getGridEl().dom)};Ext.extend(Ext.grid.HeaderDropZone,Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,getTargetFromEvent:function(B){var A=Ext.lib.Event.getTarget(B);var C=this.view.findCellIndex(A);if(C!==false){return this.view.getHeaderCell(C)}},nextVisible:function(C){var B=this.view,A=this.grid.colModel;C=C.nextSibling;while(C){if(!A.isHidden(B.getCellIndex(C))){return C}C=C.nextSibling}return null},prevVisible:function(C){var B=this.view,A=this.grid.colModel;C=C.prevSibling;while(C){if(!A.isHidden(B.getCellIndex(C))){return C}C=C.prevSibling}return null},positionIndicator:function(F,E,G){var I=Ext.lib.Event.getPageX(G);var A=Ext.lib.Dom.getRegion(E.firstChild);var J,K,H=A.top+this.proxyOffsets[1];if((A.right-I)<=(A.right-A.left)/2){J=A.right+this.view.borderWidth;K="after"}else{J=A.left;K="before"}var D=this.view.getCellIndex(F);var C=this.view.getCellIndex(E);if(this.grid.colModel.isFixed(C)){return false}var B=this.grid.colModel.isLocked(C);if(K=="after"){C++}if(D<C){C--}if(D==C&&(B==this.grid.colModel.isLocked(D))){return false}J+=this.proxyOffsets[0];this.proxyTop.setLeftTop(J,H);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(J,H+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return K},onNodeEnter:function(D,A,C,B){if(B.header!=D){this.positionIndicator(B.header,D,C)}},onNodeOver:function(E,A,D,B){var C=false;if(B.header!=E){C=this.positionIndicator(B.header,E,D)}if(!C){this.proxyTop.hide();this.proxyBottom.hide()}return C?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(D,A,C,B){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(B,K,F,H){var E=H.header;if(E!=B){var J=this.grid.colModel;var I=Ext.lib.Event.getPageX(F);var A=Ext.lib.Dom.getRegion(B.firstChild);var L=(A.right-I)<=((A.right-A.left)/2)?"after":"before";var D=this.view.getCellIndex(E);var C=this.view.getCellIndex(B);var G=J.isLocked(C);if(L=="after"){C++}if(D<C){C--}if(D==C&&(G==J.isLocked(D))){return false}J.setLocked(D,G,true);J.moveColumn(D,C);this.grid.fireEvent("columnmove",D,C);return true}return false}});Ext.grid.GridView.ColumnDragZone=function(B,A){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,B,A,null);this.proxy.el.addClass("x-grid3-col-dd")};Ext.extend(Ext.grid.GridView.ColumnDragZone,Ext.grid.HeaderDragZone,{handleMouseDown:function(A){},callHandleMouseDown:function(A){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,A)}});Ext.grid.SplitDragZone=function(C,B,A){this.grid=C;this.view=C.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,B,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(B));this.setOuterHandleElId(Ext.id(A));this.scroll=false};Ext.extend(Ext.grid.SplitDragZone,Ext.dd.DDProxy,{fly:Ext.Element.fly,b4StartDrag:function(A,D){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var B=this.cm.getColumnWidth(this.cellIndex);var C=Math.max(B-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(C,1000);this.setYConstraint(0,0);this.minX=A-C;this.maxX=A+1000;this.startPos=A;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,A,D)},handleMouseDown:function(B){ev=Ext.EventObject.setEvent(B);var A=this.fly(ev.getTarget());if(A.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(A.dom);this.split=A.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}},endDrag:function(C){this.view.headersDisabled=false;var B=Math.max(this.minX,Ext.lib.Event.getPageX(C));var A=B-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+A)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(B,A){this.view=B.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,A);if(this.view.lockedBody){this.setHandleElId(Ext.id(this.view.mainBody.dom));this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))}this.scroll=false;this.grid=B;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(C){var B=Ext.lib.Event.getTarget(C);var A=this.view.findRowIndex(B);if(A!==false){var D=this.grid.selModel;if(!D.isSelected(A)||C.hasModifier()){D.handleMouseDown(C,B)}return{grid:this.grid,ddel:this.ddel,rowIndex:A,selections:D.getSelections()}}return false},onInitDrag:function(B){var A=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(B,A){return false},onEndDrag:function(A,B){},onValidDrop:function(A,B,C){this.hideProxy()},beforeInvalidDrop:function(A,B){}});Ext.grid.ColumnModel=function(C){this.config=C;this.lookup={};for(var A=0,B=C.length;A<B;A++){var D=C[A];if(typeof D.dataIndex=="undefined"){D.dataIndex=A}if(typeof D.renderer=="string"){D.renderer=Ext.util.Format[D.renderer]}if(typeof D.id=="undefined"){D.id=A}if(D.editor&&D.editor.isFormField){D.editor=new Ext.grid.GridEditor(D.editor)}this.lookup[D.id]=D}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true});Ext.grid.ColumnModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.ColumnModel,Ext.util.Observable,{getColumnId:function(A){return this.config[A].id},getColumnById:function(A){return this.lookup[A]},getIndexById:function(C){for(var B=0,A=this.config.length;B<A;B++){if(this.config[B].id==C){return B}}return -1},moveColumn:function(B,A){var C=this.config[B];this.config.splice(B,1);this.config.splice(A,0,C);this.dataMap=null;this.fireEvent("columnmoved",this,B,A)},isLocked:function(A){return this.config[A].locked===true},setLocked:function(A,C,B){if(this.isLocked(A)==C){return }this.config[A].locked=C;if(!B){this.fireEvent("columnlockchange",this,A,C)}},getTotalLockedWidth:function(){var B=0;for(var A=0;A<this.config.length;A++){if(this.isLocked(A)&&!this.isHidden(A)){this.totalWidth+=this.getColumnWidth(A)}}return B},getLockedCount:function(){for(var B=0,A=this.config.length;B<A;B++){if(!this.isLocked(B)){return B}}},getColumnCount:function(C){if(C===true){var D=0;for(var B=0,A=this.config.length;B<A;B++){if(!this.isHidden(B)){D++}}return D}return this.config.length},getColumnsBy:function(D,C){var E=[];for(var B=0,A=this.config.length;B<A;B++){var F=this.config[B];if(D.call(C||this,F,B)===true){E[E.length]=F}}return E},isSortable:function(A){if(typeof this.config[A].sortable=="undefined"){return this.defaultSortable}return this.config[A].sortable},getRenderer:function(A){if(!this.config[A].renderer){return Ext.grid.ColumnModel.defaultRenderer}return this.config[A].renderer},setRenderer:function(A,B){this.config[A].renderer=B},getColumnWidth:function(A){return this.config[A].width||this.defaultWidth},setColumnWidth:function(A,C,B){this.config[A].width=C;this.totalWidth=null;if(!B){this.fireEvent("widthchange",this,A,C)}},getTotalWidth:function(C){if(!this.totalWidth){this.totalWidth=0;for(var B=0,A=this.config.length;B<A;B++){if(C||!this.isHidden(B)){this.totalWidth+=this.getColumnWidth(B)}}}return this.totalWidth},getColumnHeader:function(A){return this.config[A].header},setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B)},getColumnTooltip:function(A){return this.config[A].tooltip},setColumnTooltip:function(B,A){this.config[B].tooltip=A},getDataIndex:function(A){return this.config[A].dataIndex},setDataIndex:function(B,A){this.config[B].dataIndex=A},findColumnIndex:function(B){var D=this.config;for(var C=0,A=D.length;C<A;C++){if(D[C].dataIndex==B){return C}}return -1},isCellEditable:function(B,A){return(this.config[B].editable||(typeof this.config[B].editable=="undefined"&&this.config[B].editor))?true:false},getCellEditor:function(A,B){return this.config[A].editor},setEditable:function(A,B){this.config[A].editable=B},isHidden:function(A){return this.config[A].hidden},isFixed:function(A){return this.config[A].fixed},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true},setHidden:function(B,A){this.config[B].hidden=A;this.totalWidth=null;this.fireEvent("hiddenchange",this,B,A)},setEditor:function(B,A){this.config[B].editor=A}});Ext.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="string"&&A.length<1){return"&#160;"}return A};Ext.grid.DefaultColumnModel=Ext.grid.ColumnModel;Ext.grid.AbstractSelectionModel=function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.AbstractSelectionModel,Ext.util.Observable,{init:function(A){this.grid=A;this.initEvents()},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked}});Ext.grid.RowSelectionModel=function(A){Ext.apply(this,A);this.selections=new Ext.util.MixedCollection(false,function(B){return B.id});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true});this.locked=false};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("mousedown",this.handleMouseDown,this)}else{this.grid.on("rowclick",function(C,B,D){if(D.button===0&&!D.shiftKey&&!D.ctrlKey){this.selectRow(B,false);C.view.focusRow(B)}},this)}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{"up":function(C){if(!C.shiftKey){this.selectPrevious(C.shiftKey)}else{if(this.last!==false&&this.lastActive!==false){var B=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(B!==false){this.last=B}}else{this.selectFirstRow()}}},"down":function(C){if(!C.shiftKey){this.selectNext(C.shiftKey)}else{if(this.last!==false&&this.lastActive!==false){var B=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(B!==false){this.last=B}}else{this.selectFirstRow()}}},scope:this});var A=this.grid.view;A.on("refresh",this.onRefresh,this);A.on("rowupdated",this.onRowUpdated,this);A.on("rowremoved",this.onRemove,this)},onRefresh:function(){var D=this.grid.dataSource,B,A=this.grid.view;var C=this.selections;C.each(function(E){if((B=D.indexOfId(E.id))!=-1){A.onRowSelect(B)}else{C.remove(E)}})},onRemove:function(A,C,B){this.selections.remove(B)},onRowUpdated:function(A,C,B){if(this.isSelected(B)){A.onRowSelect(C)}},selectRecords:function(D,B){if(!B){this.clearSelections()}var E=this.grid.dataSource;for(var C=0,A=D.length;C<A;C++){this.selectRow(E.indexOf(D[C]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(A){this.selectRow(this.grid.dataSource.getCount()-1,A)},selectNext:function(A){if(this.last!==false&&(this.last+1)<this.grid.dataSource.getCount()){this.selectRow(this.last+1,A);this.grid.getView().focusRow(this.last)}},selectPrevious:function(A){if(this.last){this.selectRow(this.last-1,A);this.grid.getView().focusRow(this.last)}},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},clearSelections:function(A){if(this.locked){return }if(A!==true){var C=this.grid.dataSource;var B=this.selections;B.each(function(D){this.deselectRow(C.indexOfId(D.id))},this);B.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.locked){return }this.selections.clear();for(var B=0,A=this.grid.dataSource.getCount();B<A;B++){this.selectRow(B,true)}},hasSelection:function(){return this.selections.length>0},isSelected:function(B){var A=typeof B=="number"?this.grid.dataSource.getAt(B):B;return(A&&this.selections.key(A.id)?true:false)},isIdSelected:function(A){return(this.selections.key(A)?true:false)},handleMouseDown:function(F,B){var A=this.grid.getView(),E;if(this.isLocked()||(E=A.findRowIndex(B))===false){return }if(F.shiftKey&&this.last!==false){var D=this.last;this.selectRange(D,E,F.ctrlKey);this.last=D;A.focusRow(E)}else{var C=this.isSelected(E);if(F.button!=0&&C){A.focusRow(E)}else{if(F.ctrlKey&&C){this.deselectRow(E)}else{this.selectRow(E,F.button==0&&(F.ctrlKey||F.shiftKey));A.focusRow(E)}}}},selectRows:function(D,B){if(!B){this.clearSelections()}for(var C=0,A=D.length;C<A;C++){this.selectRow(D[C],true)}},selectRange:function(C,B,A){if(this.locked){return }if(!A){this.clearSelections()}if(C<=B){for(var D=C;D<=B;D++){this.selectRow(D,true)}}else{for(var D=C;D>=B;D--){this.selectRow(D,true)}}},deselectRange:function(D,C,B){if(this.locked){return }for(var A=D;A<=C;A++){this.deselectRow(A,B)}},selectRow:function(A,D,C){if(this.locked||(A<0||A>=this.grid.dataSource.getCount())){return }if(this.fireEvent("beforerowselect",this,A,D)!==false){if(!D||this.singleSelect){this.clearSelections()}var B=this.grid.dataSource.getAt(A);this.selections.add(B);this.last=this.lastActive=A;if(!C){this.grid.getView().onRowSelect(A)}this.fireEvent("rowselect",this,A,B);this.fireEvent("selectionchange",this)}},deselectRow:function(C,A){if(this.locked){return }if(this.last==C){this.last=false}if(this.lastActive==C){this.lastActive=false}var B=this.grid.dataSource.getAt(C);this.selections.remove(B);if(!A){this.grid.getView().onRowDeselect(C)}this.fireEvent("rowdeselect",this,C);this.fireEvent("selectionchange",this)},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(C,B,A){return !A.isHidden(B)&&A.isCellEditable(B,C)},onEditorKey:function(C,E){var B=E.getKey(),F,D=this.grid,A=D.activeEditor;if(B==E.TAB){E.stopEvent();A.completeEdit();if(E.shiftKey){F=D.walkCells(A.row,A.col-1,-1,this.acceptsNav,this)}else{F=D.walkCells(A.row,A.col+1,1,this.acceptsNav,this)}}else{if(B==E.ENTER&&!E.ctrlKey){E.stopEvent();A.completeEdit();if(E.shiftKey){F=D.walkCells(A.row-1,A.col,-1,this.acceptsNav,this)}else{F=D.walkCells(A.row+1,A.col,1,this.acceptsNav,this)}}else{if(B==E.ESC){A.cancelEdit()}}}if(F){D.startEditing(F[0],F[1])}}});Ext.grid.CellSelectionModel=function(A){Ext.apply(this,A);this.selection=null;this.addEvents({"beforecellselect":true,"cellselect":true,"selectionchange":true})};Ext.extend(Ext.grid.CellSelectionModel,Ext.grid.AbstractSelectionModel,{initEvents:function(){this.grid.on("mousedown",this.handleMouseDown,this);this.grid.getGridEl().on(Ext.isIE?"keydown":"keypress",this.handleKeyDown,this);var A=this.grid.view;A.on("refresh",this.onViewChange,this);A.on("rowupdated",this.onRowUpdated,this);A.on("beforerowremoved",this.clearSelections,this);A.on("beforerowsinserted",this.clearSelections,this);if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(A){this.select(A.row,A.column,false,true,A.record)},onRowUpdated:function(A,B,C){if(this.selection&&this.selection.record==C){A.onCellSelect(B,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(A){var B=this.selection;if(B){if(A!==true){this.grid.view.onCellDeselect(B.cell[0],B.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(E,D){var C=this.grid.getView();if(this.isLocked()){return }var B=C.findRowIndex(D);var A=C.findCellIndex(D);if(B!==false&&A!==false){this.select(B,A)}},select:function(A,F,E,D,C){if(this.fireEvent("beforecellselect",this,A,F)!==false){this.clearSelections();C=C||this.grid.dataSource.getAt(A);this.selection={record:C,cell:[A,F]};if(!E){var B=this.grid.getView();B.onCellSelect(A,F);if(D!==true){B.focusCell(A,F)}}this.fireEvent("cellselect",this,A,F);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(C,B,A){return !A.isHidden(B)},handleKeyDown:function(H){if(!H.isNavKeyPress()){return }var G=this.grid,J=this.selection;if(!J){H.stopEvent();var F=G.walkCells(0,0,1,this.isSelectable,this);if(F){this.select(F[0],F[1])}return }var C=this;var D=function(M,L,K){return G.walkCells(M,L,K,C.isSelectable,C)};var E=H.getKey(),B=J.cell[0],I=J.cell[1];var A;switch(E){case H.TAB:if(H.shiftKey){A=D(B,I-1,-1)}else{A=D(B,I+1,1)}break;case H.DOWN:A=D(B+1,I,1);break;case H.UP:A=D(B-1,I,-1);break;case H.RIGHT:A=D(B,I+1,1);break;case H.LEFT:A=D(B,I-1,-1);break;case H.ENTER:if(G.isEditor&&!G.editing){G.startEditing(B,I);H.stopEvent();return }break}if(A){this.select(A[0],A[1]);H.stopEvent()}},acceptsNav:function(C,B,A){return !A.isHidden(B)&&A.isCellEditable(B,C)},onEditorKey:function(C,F){var B=F.getKey(),E,D=this.grid,A=D.activeEditor;if(B==F.TAB){if(F.shiftKey){E=D.walkCells(A.row,A.col-1,-1,this.acceptsNav,this)}else{E=D.walkCells(A.row,A.col+1,1,this.acceptsNav,this)}F.stopEvent()}else{if(B==F.ENTER&&!F.ctrlKey){A.completeEdit();F.stopEvent()}else{if(B==F.ESC){A.cancelEdit()}}}if(E){D.startEditing(E[0],E[1])}}});Ext.grid.EditorGrid=function(B,A){Ext.grid.EditorGrid.superclass.constructor.call(this,B,A);this.getGridEl().addClass("xedit-grid");if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents({"beforeedit":true,"afteredit":true,"validateedit":true});this.on("bodyscroll",this.stopEditing,this);this.on(this.clicksToEdit==1?"cellclick":"celldblclick",this.onCellDblClick,this)};Ext.extend(Ext.grid.EditorGrid,Ext.grid.Grid,{isEditor:true,clicksToEdit:2,trackMouseOver:false,onCellDblClick:function(C,B,A){this.startEditing(B,A)},onEditComplete:function(C,B,A){this.editing=false;this.activeEditor=null;C.un("specialkey",this.selModel.onEditorKey,this.selModel);if(String(B)!=String(A)){var E=C.record;var D=this.colModel.getDataIndex(C.col);var F={grid:this,record:E,field:D,originalValue:A,value:B,row:C.row,column:C.col,cancel:false};if(this.fireEvent("validateedit",F)!==false&&!F.cancel){E.set(D,F.value);delete F.cancel;this.fireEvent("afteredit",F)}}this.view.focusCell(C.row,C.col)},startEditing:function(C,A){this.stopEditing();if(this.colModel.isCellEditable(A,C)){this.view.ensureVisible(C,A,true);var D=this.dataSource.getAt(C);var F=this.colModel.getDataIndex(A);var E={grid:this,record:D,field:F,value:D.data[F],row:C,column:A,cancel:false};if(this.fireEvent("beforeedit",E)!==false&&!E.cancel){this.editing=true;var B=this.colModel.getCellEditor(A,C);if(!B.rendered){B.render(B.parentEl||document.body)}(function(){B.row=C;B.col=A;B.record=D;B.on("complete",this.onEditComplete,this,{single:true});B.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=B;var G=D.data[F];B.startEdit(this.view.getCell(C,A),G)}).defer(50,this)}}},stopEditing:function(){if(this.activeEditor){this.activeEditor.completeEdit()}this.activeEditor=null}});Ext.grid.GridEditor=function(B,A){Ext.grid.GridEditor.superclass.constructor.call(this,B,A);B.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:"frame"});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=function(B,A){this.grid=B;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(A){this.setSource(A)}Ext.grid.PropertyStore.superclass.constructor.call(this)};Ext.extend(Ext.grid.PropertyStore,Ext.util.Observable,{setSource:function(C){this.source=C;this.store.removeAll();var B=[];for(var A in C){if(this.isEditableValue(C[A])){B.push(new Ext.grid.PropertyRecord({name:A,value:C[A]},A))}}this.store.loadRecords({records:B},{},true)},onUpdate:function(E,C,A){if(A==Ext.data.Record.EDIT){var B=C.data["value"];var D=C.modified["value"];if(this.grid.fireEvent("beforepropertychange",this.source,C.id,B,D)!==false){this.source[C.id]=B;C.commit();this.grid.fireEvent("propertychange",this.source,C.id,B,D)}else{C.reject()}}},getProperty:function(A){return this.store.getAt(A)},isEditableValue:function(A){if(A&&A instanceof Date){return true}else{if(typeof A=="object"||typeof A=="function"){return false}}return true},setValue:function(B,A){this.source[B]=A;this.store.getById(B).set("value",A)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=function(D,C){this.grid=D;var A=Ext.grid;A.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,sortable:true,dataIndex:"name",id:"name"},{header:this.valueText,resizable:false,dataIndex:"value",id:"value"}]);this.store=C;this.bselect=Ext.DomHelper.append(document.body,{tag:"select",style:"display:none",cls:"x-grid-editor",children:[{tag:"option",value:"true",html:"true"},{tag:"option",value:"false",html:"false"}]});Ext.id(this.bselect);var B=Ext.form;this.editors={"date":new A.GridEditor(new B.DateField({selectOnFocus:true})),"string":new A.GridEditor(new B.TextField({selectOnFocus:true})),"number":new A.GridEditor(new B.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new A.GridEditor(new B.Field({el:this.bselect,selectOnFocus:true}))};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)};Ext.extend(Ext.grid.PropertyColumnModel,Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",renderDate:function(A){return A.dateFormat(this.dateFormat)},renderBool:function(A){return A?"true":"false"},isCellEditable:function(B,A){return B==1},getRenderer:function(A){return A==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(A){return this.getPropertyName(A)},renderCell:function(A){var B=A;if(A instanceof Date){B=this.renderDate(A)}else{if(typeof A=="boolean"){B=this.renderBool(A)}}return Ext.util.Format.htmlEncode(B)},getPropertyName:function(B){var A=this.grid.propertyNames;return A&&A[B]?A[B]:B},getCellEditor:function(B,A){var C=this.store.getProperty(A);var E=C.data["name"],D=C.data["value"];if(this.grid.customEditors[E]){return this.grid.customEditors[E]}if(D instanceof Date){return this.editors["date"]}else{if(typeof D=="number"){return this.editors["number"]}else{if(typeof D=="boolean"){return this.editors["boolean"]}else{return this.editors["string"]}}}}});Ext.grid.PropertyGrid=function(D,C){C=C||{};var B=new Ext.grid.PropertyStore(this);this.store=B;var A=new Ext.grid.PropertyColumnModel(this,B);B.store.sort("name","ASC");Ext.grid.PropertyGrid.superclass.constructor.call(this,D,Ext.apply({ds:B.store,cm:A,enableColLock:false,enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1},C));this.getGridEl().addClass("x-props-grid");this.lastEditRow=null;this.on("columnresize",this.onColumnResize,this);this.addEvents({beforepropertychange:true,propertychange:true});this.customEditors=this.customEditors||{}};Ext.extend(Ext.grid.PropertyGrid,Ext.grid.EditorGrid,{render:function(){Ext.grid.PropertyGrid.superclass.render.call(this);this.autoSize.defer(100,this)},autoSize:function(){Ext.grid.PropertyGrid.superclass.autoSize.call(this);if(this.view){this.view.fitColumns()}},onColumnResize:function(){this.colModel.setColumnWidth(1,this.container.getWidth(true)-this.colModel.getColumnWidth(0));this.autoSize()},setSource:function(A){this.store.setSource(A)},getSource:function(){return this.store.getSource()}});Ext.LoadMask=function(B,C){this.el=Ext.get(B);Ext.apply(this,C);if(this.store){this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.onLoad,this);this.removeMask=false}else{var A=this.el.getUpdateManager();A.showLoadIndicator=false;A.on("beforeupdate",this.onBeforeLoad,this);A.on("update",this.onLoad,this);A.on("failure",this.onLoad,this);this.removeMask=true}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.onLoad,this)}else{var A=this.el.getUpdateManager();A.un("beforeupdate",this.onBeforeLoad,this);A.un("update",this.onLoad,this);A.un("failure",this.onLoad,this)}}};var Prototype={Version:"1.4.0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",emptyFunction:function(){},K:function(A){return A}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(A,B){for(property in B){A[property]=B[property]}return A};Object.inspect=function(A){try{if(A==undefined){return"undefined"}if(A==null){return"null"}return A.inspect?A.inspect():A.toString()}catch(B){if(B instanceof RangeError){return"..."}throw B}};Function.prototype.bind=function(){var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(B){var A=this;return function(C){return A.call(B,C||window.event)}};function $(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string"){A=document.getElementById(A)}if(arguments.length==1){return A}C.push(A)}return C}var $break=new Object();var $continue=new Object();var Enumerable={each:function(B){var A=0;try{this._each(function(D){try{B(D,A++)}catch(E){if(E!=$continue){throw E}}})}catch(C){if(C!=$break){throw C}}},collect:function(B){var A=[];this.each(function(D,C){A.push(B(D,C))});return A}};Object.extend(Enumerable,{map:Enumerable.collect});Object.extend(Array.prototype,Enumerable);Object.extend(Array.prototype,{_each:function(B){for(var A=0;A<this.length;A++){B(this[A])}}});document.getElementsByClassName=function(C,A){var B=($(A)||document.body).getElementsByTagName("*");return $A(B).inject([],function(D,E){if(E.className.match(new RegExp("(^|\\s)"+C+"(\\s|$)"))){D.push(E)}return D})};if(!window.Element){var Element=new Object()}Object.extend(Element,{visible:function(A){return $(A).style.display!="none"},toggle:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);Element[Element.visible(A)?"hide":"show"](A)}},hide:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);A.style.display="none"}},show:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);A.style.display=""}},remove:function(A){A=$(A);A.parentNode.removeChild(A)},update:function(B,A){$(B).innerHTML=A.stripScripts();setTimeout(function(){A.evalScripts()},10)},getHeight:function(A){A=$(A);return A.offsetHeight},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(A,B){if(!(A=$(A))){return }return Element.classNames(A).include(B)},addClassName:function(A,B){if(!(A=$(A))){return }return Element.classNames(A).add(B)},removeClassName:function(A,B){if(!(A=$(A))){return }return Element.classNames(A).remove(B)},cleanWhitespace:function(B){B=$(B);for(var A=0;A<B.childNodes.length;A++){var C=B.childNodes[A];if(C.nodeType==3&&!/\S/.test(C.nodeValue)){Element.remove(C)}}},empty:function(A){return $(A).innerHTML.match(/^\s*$/)},scrollTo:function(B){B=$(B);var A=B.x?B.x:B.offsetLeft,C=B.y?B.y:B.offsetTop;window.scrollTo(A,C)},getStyle:function(B,C){B=$(B);var D=B.style[C.camelize()];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);D=A?A.getPropertyValue(C):null}else{if(B.currentStyle){D=B.currentStyle[C.camelize()]}}}if(window.opera&&["left","top","right","bottom"].include(C)){if(Element.getStyle(B,"position")=="static"){D="auto"}}return D=="auto"?null:D},setStyle:function(A,B){A=$(A);for(name in B){A.style[name.camelize()]=B[name]}},getDimensions:function(B){B=$(B);if(Element.getStyle(B,"display")!="none"){return{width:B.offsetWidth,height:B.offsetHeight}}var A=B.style;var E=A.visibility;var C=A.position;A.visibility="hidden";A.position="absolute";A.display="";var F=B.clientWidth;var D=B.clientHeight;A.display="none";A.position=C;A.visibility=E;return{width:F,height:D}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(window.opera){A.style.top=0;A.style.left=0}}},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}},makeClipping:function(A){A=$(A);if(A._overflow){return }A._overflow=A.style.overflow;if((Element.getStyle(A,"overflow")||"visible")!="hidden"){A.style.overflow="hidden"}},undoClipping:function(A){A=$(A);if(A._overflow){return }A.style.overflow=A._overflow;A._overflow=undefined}});var Toggle=new Object();Toggle.display=Element.toggle;Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){var B=Form.getElements(this.element);for(var A=0;A<B.length;A++){this.registerCallback(B[A])}},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;case"password":case"text":case"textarea":case"select-one":case"select-multiple":Event.observe(A,"change",this.onElementEvent.bind(this));break}}}};if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(A){return A.target||A.srcElement},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))},pointerX:function(A){return A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(A){return A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(A){if(A.preventDefault){A.preventDefault();A.stopPropagation()}else{A.returnValue=false;A.cancelBubble=true}},findElement:function(C,B){var A=Event.element(C);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A},observers:false,_observeAndCache:function(D,C,B,A){if(!this.observers){this.observers=[]}if(D.addEventListener){this.observers.push([D,C,B,A]);D.addEventListener(C,B,A)}else{if(D.attachEvent){this.observers.push([D,C,B,A]);D.attachEvent("on"+C,B)}}},unloadCache:function(){if(!Event.observers){return }for(var A=0;A<Event.observers.length;A++){Event.stopObserving.apply(this,Event.observers[A]);Event.observers[A][0]=null}Event.observers=false},observe:function(D,C,B,A){var D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.attachEvent)){C="keydown"}this._observeAndCache(D,C,B,A)},stopObserving:function(D,C,B,A){var D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.detachEvent)){C="keydown"}if(D.removeEventListener){D.removeEventListener(C,B,A)}else{if(D.detachEvent){D.detachEvent("on"+C,B)}}}});Event.observe(window,"unload",Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode}while(B);return[C,A]},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return[C,A]},positionedOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent;if(B){p=Element.getStyle(B,"position");if(p=="relative"||p=="absolute"){break}}}while(B);return[C,A]},offsetParent:function(A){if(A.offsetParent){return A.offsetParent}if(A==document.body){return A}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return A}}return document.body},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=this.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=this.realOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=this.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},clone:function(B,C){B=$(B);C=$(C);C.style.position="absolute";var A=this.cumulativeOffset(B);C.style.top=A[1]+"px";C.style.left=A[0]+"px";C.style.width=B.offsetWidth+"px";C.style.height=B.offsetHeight+"px"},page:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}}while(B=B.offsetParent);B=D;do{A-=B.scrollTop||0;C-=B.scrollLeft||0}while(B=B.parentNode);return[C,A]},clone:function(C,E){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});C=$(C);var D=Position.page(C);E=$(E);var F=[0,0];var B=null;if(Element.getStyle(E,"position")=="absolute"){B=Position.offsetParent(E);F=Position.page(B)}if(B==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){E.style.left=(D[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){E.style.top=(D[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){E.style.width=C.offsetWidth+"px"}if(A.setHeight){E.style.height=C.offsetHeight+"px"}},absolutize:function(B){B=$(B);if(B.style.position=="absolute"){return }Position.prepare();var D=Position.positionedOffset(B);var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px"},relativize:function(A){A=$(A);if(A.style.position=="relative"){return }Position.prepare();A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}B=B.offsetParent}while(B);return[C,A]}}var urlParams=Ext.urlDecode(window.location.search.substr(1));var staticServerList={_local:"../",_google:"http://ajaxanimator.googlecode.com/svn/trunk/Animator/stable",_110mb:"http://antimatter15.110mb.com/Animator/"};var currentServer;function setServer(B){if(typeof (B)==typeof (undefined)){currentServer=staticServerList["_local"]}if(typeof (B)==typeof ("string")){if(B.length<1){currentServer=staticServerList["_local"];return }currentServer=staticServerList["_"+B.replace(/_/,"")]}else{if(typeof (B)==typeof (42)){var A=[];for(x in staticServerList){A.push(staticServerList[x])}currentServer=A[B]}}}setServer(urlParams["hotlink"]);if(typeof (altStatic)!=typeof (undefined)){setServer("_google")}if(urlParams["hotlink"]=="false"){setServer("_local")}var themeURL,imgURL;function resetThemeImgURL(){themeURL=currentServer+"resources";imgURL=currentServer+"images"}resetThemeImgURL();Ext.BLANK_IMAGE_URL=themeURL+"/images/default/s.gif";var onreadyfunct=new Array();Ext.namespace("ajaxanimator");var cssLoaded=false;if(!document.createElementNS){document.createElementNS=function(B,A){return document.createElement(A)}}ajaxanimator.app=function(){return{init:function(){interLoad();Ext.QuickTips.interceptTitles=true;Ext.QuickTips.showDelay=10;Ext.QuickTips.init()}}}();function setLoad(A,B){document.getElementById("loading-msg").innerHTML=A;var C=((B/100)*(Ext.get("loadProgressBorder").getWidth()))-3;$("loadProgressBar").style.width=C+"px"}ajaxanimator.onReady=function(A){onreadyfunct.push(A)};ajaxanimator.doReady=function(){for(var A=0;A<onreadyfunct.length;A++){if(onreadyfunct[A]){onreadyfunct[A]()}}finalizeInit()};Ext.onReady(ajaxanimator.app.init,ajaxanimator.app);function hideLoadingMask(){var B=Ext.get("loading");var A=Ext.get("loading-mask");A.shift({remove:true,duration:0.2,opacity:0,callback:function(){B.fadeOut({duration:0.5,remove:true})}})}window.onload=function(){setTimeout("showTehAdz()",10000)};function interLoad(){setLoad("Building Interface...",65);if(urlParams["hidesplash"]!="false"){setTimeout("ajaxanimator.doReady();",10)}}function finalizeInit(){setLoad("Finalizing Load...",99);hideLoadingMask();sendStats()}ajaxanimator.onReady(function(){addLayer();if(Ext.isIE!=true||urlParams["ignoreIE"]=="ignore"){setTimeout("initCanvas();",0)}else{IEMessage()}});function loadCSS(B){var A=makeCSSEl({href:B});document.getElementsByTagName("HEAD")[0].appendChild(A)}function makeCSSEl(B){var A=document.createElement("link");A.setAttribute("type","text/css");A.setAttribute("rel","stylesheet");for(x in B){A.setAttribute(x,B[x])}return A}function setTheme(B){var D=function(E){if(!document.getElementById("theme")){document.getElementsByTagName("head")[0].appendChild(makeCSSEl({id:"theme"}))}Ext.get("theme").dom.href=E};var A=["default","gray","vista","aero","galdaka"];var C="default";if(typeof (B)==typeof (4)){C=A[B]}else{if(typeof (B)==typeof ("ajaxanimator")){C=B}}if(C=="default"){Ext.get("theme").remove()}else{D(themeURL+"/css/xtheme-"+C+".css")}}var mainLayout;var exportText;var pButton=new Ext.Toolbar.Button({text:"Reload Preview",handler:function(){preFlash}});var eButton=new Ext.Toolbar.Button({text:"Export Animation",handler:function(){genFlash()}});ajaxanimator.onReady(function(){var B=new Ext.Toolbar("north-tb");var D=new Ext.Toolbar("center-tb");var E=new Ext.Toolbar("user-tb");var C=new Ext.Toolbar("history-tb");var A=new Ext.Toolbar("preview-tb");mainLayout=new Ext.BorderLayout(document.body,{north:{titlebar:false,split:true,initialSize:100,collapsible:true,toolbar:B},south:{titlebar:true,split:true,initialSize:60,collapsible:true},east:{titlebar:false,split:true,initialSize:130,collapsible:true},west:{titlebar:true,split:true,initialSize:55,collapsible:true},center:{}});mainLayout.beginUpdate();mainLayout.add("north",new Ext.ContentPanel("north-div",{autoScroll:false,fitToFrame:true,closable:false}));mainLayout.add("south",new Ext.ContentPanel("properties-div",{title:"Properties",fitToFrame:true,closable:false}));mainLayout.add("east",new Ext.ContentPanel("history-div",{title:"History",toolbar:C,fitToFrame:true,closable:false}));mainLayout.add("east",new Ext.ContentPanel("user-div",{title:"User",toolbar:E,fitToFrame:true,closable:false}));mainLayout.add("west",new Ext.ContentPanel("toolbar-div",{title:"Tools",fitToFrame:true,closable:false}));mainLayout.add("center",new Ext.ContentPanel("canvas-div",{toolbar:D,title:"Canvas",fitToFrame:true}));mainLayout.add("center",new Ext.ContentPanel("preview-div",{toolbar:A,title:"Preview",fitToFrame:true}));mainLayout.getRegion("center").showPanel("canvas-div");mainLayout.getRegion("east").showPanel("history-div");mainLayout.getRegion("south").showPanel("properties-div");mainLayout.getRegion("east").getPanel("user-div").on("activate",function(F){if(!userField){drawLogin();smartLogin()}});mainLayout.getRegion("north").getPanel("north-div").on("resize",timelineResize);mainLayout.getRegion("west").getPanel("toolbar-div").on("resize",function(){if(lineWidth){lineWidth.setSize(lineWidth.container.getWidth())}});mainLayout.getRegion("center").getPanel("preview-div").on("activate",function(F){editControlToolbar("previewControlBar",2);preFlash()});mainLayout.endUpdate();timelineResize()});function timelineResize(){setTimeout('Ext.get("frameContainer").setHeight(parseInt(Ext.get("frameContainer").dom.parentNode.style.height)-30)',0)}var disablePopupAds=false;function openDebug(){startCheckDebugger()}function startCheckDebugger(A){if(Ext.log){Ext.log("Debug Console Opened");return }if(!A||A==1){var B=document.createElement("script");B.type="text/javascript";B.src="../ext/debug-min.js"}else{if(A==2){var B=document.createElement("script");B.type="text/javascript";B.src=alternateHost+"/ext/debug-min.js"}else{if(A==3){Ext.MessageBox.alert("Error","Failed to open debug console")}}}checkDebug()}function checkDebug(A){if(Ext.log){Ext.log("Debug Console Opened")}else{if(trues>5){startCheckDebugger(2);return }setTimeout("checkDebug("+(A+1)+")",100)}}var colorDialog;var GoogAd;function showColorDialog(){if(!colorDialog){initColor();colorDialog=new Ext.LayoutDialog("color-dialog",{modal:false,width:285,height:285,shadow:true,minWidth:8,minHeight:8,proxyDrag:true,center:{autoScroll:true,tabPosition:"top",closeOnTab:true,alwaysShowTabs:true}});colorDialog.addKeyListener(27,colorDialog.hide,colorDialog);var A=colorDialog.getLayout();A.beginUpdate();A.add("center",new Ext.ContentPanel("colorPicker",{title:"Color Picker"}));A.add("center",new Ext.ContentPanel("colorPalette",{title:"Color Palette"}));A.endUpdate()}else{picker.huePointer.dom.style.left="-2px"}colorDialog.show()}function showTehAdz(){if(disablePopupAds){return }if($("GoogAd")){if($("GoogAdBody").innerHTML.replace(/\s+/g,"").length>15){if(!GoogAd){GoogAd=new Ext.BasicDialog("GoogAd",{modal:false,width:360,height:330,shadow:true,minWidth:360,minHeight:330})}GoogAd.show();setTimeout("showTehAdz()",30000)}}}function hex2rgb(B){var A=B.toLowerCase().match(RegExp("^#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$"));return Array(parseInt(A[1],16),parseInt(A[2],16),parseInt(A[3],16))}ajaxanimator.onReady(function(){Ext.QuickTips.register({target:"fillcolor",text:"Click To Change Fill Color"});Ext.QuickTips.register({target:"linecolor",text:"Click To Change Line Color"});Colorobj=document.getElementById("linecolor")});function LineColorChange(){showColorDialog();Colorobj=document.getElementById("linecolor")}function FillColorChange(){showColorDialog();Colorobj=document.getElementById("fillcolor")}function initColor(){displayColor()}function colorChangeHandler(A,C){var B=hex2rgb(C);Colorobj.style.backgroundColor="rgb("+B[0]+","+B[1]+","+B[2]+")";Colorobj.innerHTML=C;if(Colorobj.id=="fillcolor"){setFillColor("rgb("+B[0]+","+B[1]+","+B[2]+")")}else{setLineColor("rgb("+B[0]+","+B[1]+","+B[2]+")")}}function displayColor(){if(!picker){picker=new Ext.ux.ColorPicker("colorPicker",{hidePanel:false,captions:{red:"red",green:"grn",blue:"blue",hue:"hue",saturation:"sat",brightness:"val",hexa:"col.",colorHotPoint:{x:3,y:3}},animate:true});picker.on("pickcolor",colorChangeHandler);picker.huePointer.dom.style.left="-2px";var A=new Ext.ColorPalette({value:"000000"});A.render("colorPalette");A.on("select",function(C,B){picker.setColor(B)})}}var canvasHeightField;var canvasWidthField;var previewRevisionStore;var previewRevision;var framerateField;var regbutton;var logoutbutton;var loginbutton;var userMessage;var canceltutorial;var currentZoom=100;ajaxanimator.onReady(function(){var Q=new Ext.Toolbar("north-tb");var M=new Ext.menu.Menu({id:"themeMenu",items:[new Ext.menu.CheckItem({id:"aero",text:"Aero Glass",group:"theme",checkHandler:function(T,S){if(S){setTheme(T.id)}}}),new Ext.menu.CheckItem({id:"vista",text:"Vista Black",group:"theme",checkHandler:function(T,S){if(S){setTheme(T.id)}}}),new Ext.menu.CheckItem({id:"gray",text:"Gray Theme",group:"theme",checkHandler:function(T,S){if(S){setTheme(T.id)}}}),new Ext.menu.CheckItem({id:"default",text:"Ext Default",group:"theme",checked:true,checkHandler:function(T,S){if(S){setTheme(T.id)}}}),new Ext.menu.CheckItem({id:"galdaka",text:"Galdaka Theme",group:"theme",checkHandler:function(T,S){if(S){setTheme(T.id)}}})]});var A=new Ext.menu.Menu({id:"fileMenu",items:[{text:"New",icon:imgURL+"/new.png",handler:function(){confirmNewCanvas()}},{text:"Open",icon:imgURL+"/open.gif",menu:{items:[{text:"From Computer",icon:imgURL+"/computer.png",handler:function(){openfromcomputer()}},{text:"From Webserver",icon:imgURL+"/server.png",handler:function(){}},{text:"From Text",icon:imgURL+"/textfield.png",handler:function(){openfromtext()}}]}},{text:"Save",icon:imgURL+"/disk.gif",menu:{items:[{text:"To Computer",icon:imgURL+"/computer.png",handler:function(){saveAnimation()}},{text:"To Webserver",icon:imgURL+"/server.png",handler:function(){savetoserver()}},{text:"As Text",icon:imgURL+"/textfield.png",handler:function(){savetotext()}}]}},"-",{text:"Publish",icon:imgURL+"/page_white_flash.png",handler:function(){genFlash()}}]});var O=new Ext.menu.Menu({id:"editMenu",items:[{text:"Undo",icon:imgURL+"/arrow_undo.png",handler:function(){try{undo()}catch(S){}}},{text:"Copy",icon:imgURL+"/page_copy.png",handler:function(){copyObj()}},{text:"Paste",icon:imgURL+"/page_paste.png",handler:function(){pasteObj()}}]});var N=new Ext.menu.Menu({id:"viewMenu",items:[{text:"Animation",icon:imgURL+"/page_white_flash.png",handler:function(){mainLayout.getRegion("center").showPanel("preview-div")}},{text:"Theme",icon:imgURL+"/application_double.png",menu:M}]});var C=new Ext.menu.Menu({id:"toolsMenu",items:[{text:"Clear Timeline",icon:imgURL+"/cancel.png",handler:function(){mainLayout.getRegion("center").showPanel("preview-div")}},{text:"Color Picker",icon:imgURL+"/color_wheel.png",handler:function(){showColorDialog()}},{text:"Script/Macro Executor",icon:imgURL+"/application_xp_terminal.png",handler:function(){mainLayout.getRegion("south").showPanel("scriptExec-div")}},{text:"Debug Window",icon:imgURL+"/brick_go.png",handler:function(){openDebug()}},{text:"Reload Application",icon:imgURL+"/action_refresh.gif",handler:function(){window.location.reload(true)}},{text:"Benchmark",icon:imgURL+"/add.png",handler:function(){var S=(new Date).getTime();brickwall(10,10,10,10,10,10);explosionbackend(30);alert((new Date).getTime()-S)}}]});var J=new Ext.menu.Menu({id:"timelineMenu",items:[{text:"To Keyframe",icon:imgURL+"/add.png",handler:function(){toKeyframe()}},{text:"Clear Frame",icon:imgURL+"/delete.png",handler:function(){removeKeyframe()}},{text:"Refresh Data",icon:imgURL+"/action_refresh.gif",handler:function(){fullgotoframe()}},{text:"New Layer",icon:imgURL+"/add.png",handler:function(){addLayer()}},{text:"Purge Empty Frames",icon:imgURL+"/delete.png",handler:function(){purgeEmpty()}}]});var H=new Ext.menu.Menu({id:"animationMenu",items:[{text:"Play",icon:imgURL+"/control_play_blue.png",handler:function(){playAnimation()}},{text:"Stop",icon:imgURL+"/control_stop_blue.png",handler:function(){stopAnimation()}},{text:"Next Frame",icon:imgURL+"/control_fastforward_blue.png",handler:function(){nextFrame()}},{text:"Previous Frame",icon:imgURL+"/control_rewind_blue.png",handler:function(){preFrame()}},{text:"Last Frame",icon:imgURL+"/control_end_blue.png",handler:function(){lastFrame()}},{text:"First Frame",icon:imgURL+"/control_start_blue.png",handler:function(){firstFrame()}},{text:"Set Last Frame",icon:imgURL+"/control_end_blue.png",handler:function(){setLastFrame()}},{text:"Recalculate Tweens",icon:imgURL+"/action_refresh.gif",handler:function(){recalculateTweens()}}]});var E=new Ext.menu.Menu({id:"effectsMenu",items:[{text:"Random Square",icon:imgURL+"/add.png",handler:function(){randomRect()}},{text:"Explode",icon:imgURL+"/add.png",handler:function(){explode()}},{text:"Translate Shapes",icon:imgURL+"/add.png",handler:function(){translateShapes()}},{text:"Brick Wall",icon:imgURL+"/add.png",handler:function(){brickwallgui()}},{text:"Bak2Start",icon:imgURL+"/add.png",handler:function(){bak2start()}},{text:"Add Text",icon:imgURL+"/add.png",handler:function(){textgui()}},{text:"List Installed Fonts",icon:imgURL+"/add.png",handler:function(){listInstalledFonts()}}]});var I=new Ext.menu.Menu({id:"userMenu",items:[{text:"Logout",icon:imgURL+"/logout.png",handler:function(){logout()}},{text:"Refresh Animation List",icon:imgURL+"/action_refresh.gif",handler:function(){animationList()}},{text:"Browse Animations",icon:imgURL+"/user_go.png",handler:function(){showUADialog()}}]});var B=new Ext.menu.Menu({id:"helpMenu",items:[{text:"About",icon:imgURL+"/help.png",handler:function(){showAbout()}},{text:"Key Shortcuts",icon:imgURL+"/help.png",handler:function(){showKeyGuide()}},{text:"Manual",icon:imgURL+"/help.png",handler:function(){Ext.MessageBox.alert("LA LA LA","Okay, so um.... play around until it breaks?")}},{text:"FAQ",icon:imgURL+"/help.png",handler:poop},{text:"Seizure",icon:imgURL+"/help.png",handler:function(){Ext.MessageBox.alert("Yo!","Hey, this is a ANIMATOR application, ISN'T it? Make one yourself, if you really want, there's a demo/sample somewhere")}},{text:"Support",icon:imgURL+"/money.png",handler:function(){Ext.MessageBox.alert("Blah","Um... Hi")}},{text:"Interactive Tutorial",icon:imgURL+"/help.png",handler:function(){basictutorial2()}}]});Q.addButton({text:"File",menu:A});Q.addButton({text:"Edit",menu:O});Q.addButton({text:"View",menu:N});Q.addButton({text:"Tools",menu:C});Q.addButton({text:"Timeline",menu:J});Q.addButton({text:"Animation",menu:H});Q.addButton({text:"Effects",menu:E});Q.addButton({text:"User",menu:I});Q.addButton({text:"Help",menu:B});Q.add(new Ext.Toolbar.Fill());userMessage=Q.addButton({text:"Welcome&nbsp;Guest",handler:function(){mainLayout.getRegion("east").showPanel("-div")}});var G=new Ext.Toolbar("user-tb");G.addText("User");G.addSeparator();regbutton=G.addButton({id:"registerButton",text:"Register",handler:function(){renderRegister()}});logoutbutton=G.addButton({id:"logoutButton",text:"Logout",handler:function(){logout()}});loginbutton=G.addButton({id:"loginButton",text:"Login",handler:function(){hideRegister()}});logoutbutton.setVisible(false);loginbutton.setVisible(false);var P=new Ext.Toolbar("history-tb");P.addText("History");P.addSeparator();P.addButton({text:"Clear",handler:function(){resetHistory()}});var L=new Ext.Toolbar("center-tb");canvasWidthField=new Ext.form.TextField({value:"480",width:"50px",tooltip:"Set the Width of the Canvas"});canvasHeightField=new Ext.form.TextField({value:"272",width:"50px"});framerateField=new Ext.form.TextField({value:"12",width:"50px"});canvasWidthField.on("change",function(S,U,T){canvasWidth=parseInt(U);setCP()});canvasHeightField.on("change",function(S,U,T){canvasHeight=parseInt(U);setCP()});framerateField.on("change",function(S,U,T){AnimationFramerate=parseInt(U)});var D=new Ext.form.Checkbox({boxLabel:"Automatic Tweening",checked:true});D.on("check",function(T,S){autotween=S});L.addText("Width:");L.addField(canvasWidthField);L.addText("Height:");L.addField(canvasHeightField);L.addText("Framerate:");L.addField(framerateField);L.addText("&nbsp;");L.addField(D);L.addText("&nbsp;");canceltutorial=L.addButton({text:"<b>Cancel Tutorial</b>",handler:function(){canceltutorial.setVisible(false);document.body.removeChild(iga);document.body.removeChild(igt);tutorial="cancel"},id:"canceltutorial"});canceltutorial.setVisible(false);L.add(new Ext.Toolbar.Fill());L.addText("Zoom:");var R=new Ext.data.SimpleStore({fields:["size"],data:[["10%"],["25%"],["50%"],["75%"],["100%"],["125%"],["150%"],["200%"]]});var K=new Ext.form.ComboBox({store:R,displayField:"size",typeAhead:true,mode:"local",value:"100%",width:100,triggerAction:"all",selectOnFocus:true,resizable:true});K.on("select",function(S){currentZoom=parseInt(S.value);console.log(currentZoom);canvasHeight=272*(currentZoom/100);canvasWidth=480*(currentZoom/100);setCP()});L.addField(K);var F=new Ext.Toolbar("preview-tb");F.addText("Preview");F.add("-");F.addButton(pButton);F.addButton(eButton);exportText=new Ext.menu.TextItem("");F.add(exportText);F.add(new Ext.Toolbar.Fill());previewRevisionStore=new Ext.data.SimpleStore({fields:["revision"],data:[["Revision: 0(Empty)"]]});previewRevision=new Ext.form.ComboBox({store:previewRevisionStore,displayField:"revision",typeAhead:true,mode:"local",value:"Revision: 0(Empty)",triggerAction:"all",selectOnFocus:true,resizable:true});previewRevision.on("select",function(S){$("zFlashPreviewDiv").innerHTML=genFlashHTML(animationRevisionURL[parseInt(S.value.substring(S.value.indexOf(":")+1))])});F.add(previewRevision)});function poop(){Ext.MessageBox.alert("Error!","This version you are using is incomplete, or this feature has not yet been implemented, and/or transferred from dhtmlgoodies to Ext, or being rewritten")}ajaxanimator.onReady(function(){var D=new Ext.menu.Menu({id:"timelineContextMenu",items:[{text:"To Keyframe",icon:imgURL+"/add.png",handler:function(){toKeyframe()}},{text:"Add Layer",icon:imgURL+"/add.png",handler:function(){addLayer()}},{text:"Set Last Frame",icon:imgURL+"/control_end_blue.png",handler:function(){setLastFrame()}},{text:"Clear Frame",icon:imgURL+"/cancel.png",handler:function(){removeKeyframe()}}]});Ext.get("frameContainer").on("contextmenu",function(F){D.showAt(F.getXY());F.stopEvent();F.stopPropagation();F.preventDefault});var A=new Ext.menu.Menu({id:"drawToolSubmenu",items:[{text:"Select",icon:imgURL+"/select.gif",handler:function(){poop()}},{text:"Rectangle",icon:imgURL+"/rectangle.gif",handler:function(){poop()}},{text:"Round Rectangle",icon:imgURL+"/roundrect.gif",handler:function(){poop()}},{text:"Ellipse/Circle",icon:imgURL+"/circle.gif",handler:function(){removeKeyframe()}},{text:"Line",icon:imgURL+"/line.gif",handler:function(){removeKeyframe()}}]});var C=new Ext.menu.Menu({id:"lineColorMenu",items:[new Ext.menu.ColorItem({selectHandler:function(G,F){Colorobj=document.getElementById("linecolor");if(picker){picker.setColor(F)}else{colorChangeHandler(null,F)}}})]});var E=new Ext.menu.Menu({id:"fillColorMenu",items:[new Ext.menu.ColorItem({selectHandler:function(G,F){Colorobj=document.getElementById("fillcolor");if(picker){picker.setColor(F)}else{colorChangeHandler(null,F)}}})]});var B=new Ext.menu.Menu({id:"canvasContextMenu",items:[{text:"Next Frame",icon:imgURL+"/control_fastforward_blue.png",handler:poop},{text:"Previous Frame",icon:imgURL+"/control_rewind_blue.png",handler:poop},{text:"Play",icon:imgURL+"/control_play_blue.png",handler:poop},{text:"Delete Shape",icon:imgURL+"/delete.png",handler:poop},{text:"Clear Frame",icon:imgURL+"/cancel.png",handler:poop},{text:"Undo",icon:imgURL+"/arrow_undo.png",handler:poop},{text:"Drawing Tool",icon:imgURL+"/paintbrush.png",menu:A},{text:"Fill Color",icon:imgURL+"/color_wheel.png",menu:E},{text:"Line Color",icon:imgURL+"/color_wheel.png",menu:C}]});Ext.get("canvas-div").on("contextmenu",function(F){B.showAt(F.getXY());F.stopEvent();F.stopPropagation();F.preventDefault})});var keyframeArray=new Array();var tweenArray=new Array();var tweenRecalc=new Array();var currentFrame=1;var currentLayer=1;var totalFrames=1;var layerMaxFrames=300;var layerCount=0;var frameTable;function getObjects(A){return DrawCanvas[A].renderer.svgRoot.childNodes.length}function frameIsEmpty(B,A){if(typeof (DrawCanvas)!=typeof (undefined)){if(DrawCanvas){if(DrawCanvas[B]){if(DrawCanvas[B].renderer.getMarkup().length>20){return false}}}}return true}function getFrameSVG(A){return DrawCanvas[A].renderer.svgRoot}function setFrameClass(A,B){if(!B){B=getFrameObj()}if(typeof (B)!="string"){B.className=A}else{setFrameClass(A,$(B))}}function getFrameObj(B,A){if(B&&A){return $("frame"+B+"layer"+A)}else{return getFrameObj(currentFrame,currentLayer)}}function isTween(B,A){if(B&&A){if((";"+tweenArray.join(";")).indexOf(";"+B+","+A)!=-1){return true}else{return false}}else{return isTween(currentFrame,currentLayer)}}function isKeyframe(B,A){if(B&&A){if((";"+keyframeArray.join(";")).indexOf(";"+B+","+A)!=-1){return true}else{return false}}else{return isKeyframe(currentFrame,currentLayer)}}function nextFrame(){gotoframe(parseInt(currentFrame)+1,currentLayer)}function preFrame(){gotoframe(parseInt(currentFrame)-1,currentLayer)}function firstFrame(){gotoframe(1,currentLayer)}function lastFrame(){gotoframe(parseInt(totalFrames),currentLayer)}function setLastFrame(A){if(!A){totalFrames=currentFrame;gotoframe(currentFrame,currentLayer)}else{totalFrames=A;reRender("td[class=lastFrame]");setFrameClass("lastFrame",getFrameObj(totalFrames,currentLayer));renderFrame(A,currentLayer)}}function toKeyframe(B,A){if(!isTween(B,A)){B=(B)?B:currentFrame;A=(A)?A:currentLayer;keyframeArray.push(B+","+A);gotoframe(B,A)}}function removeKeyframe(B,A){B=(B)?B:currentFrame;A=(A)?A:currentLayer;keyframeArray=keyframeArray.join(";").split(B+","+A+";").join("").split(";");gotoframe(B,A)}function basicGotoframeUI(B,A){B=(B)?B:currentFrame;A=(A)?A:currentLayer;renderFrame(currentFrame,currentLayer,true);renderFrame(B,A)}function renderFrame(D,B,C){D=(D)?D:currentFrame;B=(B)?B:currentLayer;var A=(C)?"un":"";if(isKeyframe(D,B)){setFrameClass(A+"selKeyframe",getFrameObj(D,B))}else{if(!isTween(D,B)){setFrameClass(A+"selFrame",getFrameObj(D,B))}else{setFrameClass(A+"selTween",getFrameObj(D,B))}}}function fullgotoframe(){var D=currentFrame;var B=currentLayer;for(var A=0;A<layerCount;A++){for(var C=0;C<totalFrames;C++){renderFrame(C,A,true)}}reRender("td[class=lastFrame]");setFrameClass("lastFrame",getFrameObj(totalFrames,currentLayer));renderFrame(D,B)}function reRender(C){var D=Ext.select(C)["elements"];for(var A=0;A<D.length;A++){var B=D[A].id.replace("frame","").split("layer");renderFrame(B[0],B[1],true)}}function gotoframeUI(B,A){B=(B)?B:currentFrame;A=(A)?A:currentLayer;basicGotoframeUI(B,A);reRender("td[class=lastFrame]");setFrameClass("lastFrame",getFrameObj(totalFrames,currentLayer));renderFrame(B,A);currentFrame=B;currentLayer=A}function gotoframe(D,B){if(typeof (D)!=typeof (42)){D=parseInt(D)}if(typeof (B)!=typeof (42)){B=parseInt(B)}if(D<1){return }var A=frameTable.firstChild.childNodes[currentLayer-1].childNodes.length-1;if(D>A){for(var C=1;C<1+(D-A);C++){addFrame();layerMaxFrames++}$("frameContainer").scrollLeft=$("frameContainer").scrollWidth}if(D>totalFrames){totalFrames=D}gotoframeCanvas(D,B);gotoframeUI(D,B)}function gotoframeCanvas(B,A){DrawCanvas[currentCanvas].unselect();frameCheckEdit();previousCanvas=currentCanvas;hideCurrentCanvas();currentCanvas=B;if(DrawCanvas[currentCanvas]==null){makeCanvasFromId(B);editHistoryNumber++;addHistory("Add&nbsp;Frame");if(getObjects(previousCanvas)>0){loadFrame($("richdraw"+previousCanvas).innerHTML,currentCanvas)}}showCurrentCanvas();setCanvasProperties()}function gotoframeMinimal(B,A){if(DrawCanvas[B]==null){makeCanvasFromId(B)}}function frameCheckEdit(){if(!isTween(currentFrame)&&!AnimationPlay){var C=1;if(keyframeArray.length>1){C=parseInt(keyframeArray[keyframeArray.length-1].split(",")[0])}if(C==currentFrame&&C!=1){C=parseInt(keyframeArray[keyframeArray.length-2].split(",")[0])}var A;if(keyframeArray.length<1){if(!frameIsEmpty(1)){A="D1"}}else{A=parseDiff(getFrameSVG(currentFrame),getFrameSVG(C))}if(A=="D2"){createTween(C,currentFrame);tweenRecalc.push(C+","+currentFrame);for(var B=C+1;B<currentFrame;B++){tweenArray.push(B+","+currentLayer);renderFrame(B,currentLayer,true)}tweenArray=tweenArray.unique();if(!isKeyframe(currentFrame,currentLayer)){toKeyframe(currentFrame,currentLayer)}}if(A=="D1"){if(!isTween(currentFrame,currentLayer)){toKeyframe(currentFrame,currentLayer)}}}}function recalculateTweens(B){if(!AnimationPlay){if(B=="fast"){if(tweenRecalc[tweenRecalc.length-1]){createTween(parseInt(tweenRecalc[tweenRecalc.length-1].split(",")[0]),parseInt(tweenRecalc[tweenRecalc.length-1].split(",")[1]))}}else{for(var A=0;A<tweenRecalc.length;A++){createTween(parseInt(tweenRecalc[A].split(",")[0]),parseInt(tweenRecalc[A].split(",")[1]))}}}}function rctInterval(A){if(editHistoryNumber!=A){A=editHistoryNumber;recalculateTweens("fast")}setTimeout("rctInterval("+A+")",5000)}function initTimelineTable(A){frameTable=document.createElement("table");frameTable.className="timeline";frameTable.setAttribute("cellspacing","0px");frameTable.setAttribute("border","1px");frameTable.setAttribute("width","100%");frameTable.appendChild(document.createElement("tbody"));A.appendChild(frameTable)}function addFrame(D,A){if(!D){var B=frameTable.firstChild.childNodes[currentLayer-1];i=B.childNodes.length}else{i=D}var C=document.createElement("td");setFrameClass("unselFrame",C);C.id="frame"+i.toString()+"layer"+layerCount.toString();C.innerHTML=i.toString();C.onmousedown=function(G){try{var F=(!G)?window.event.srcElement:G.target;var H=F.id.replace("frame","").split("layer");gotoframe(H[0],H[1])}catch(E){}};C.onmouseover=function(G){try{var F=(!G)?window.event.srcElement:G.target;var H=F.id.replace("frame","").split("layer");Ext.QuickTips.tips({target:F.id,text:tooltipData(H[0],H[1]),width:122,autoHide:true})}catch(E){}};if(D){return C}else{B.appendChild(C)}}function addLayer(){layerCount++;if(!frameTable){initTimelineTable($("frameContainer"))}var C=frameTable.firstChild;var A=document.createElement("tr");A.className="";var D=document.createElement("td");D.innerHTML="Layer&nbsp;"+layerCount.toString();D.className="layerTitle";A.appendChild(D);for(var B=1;B<layerMaxFrames;B++){A.appendChild(addFrame(B))}C.appendChild(A)}function tooltipData(C,A){var B="";bold=function(D){return"<b>"+D+"</b>"};format=function(E,D){B+="<table cellspacing='0px' border='0px' width='100%'><tr><td>"+bold(E+":")+"</td><td align='right'>"+D+"</td></tr></table>"};format("frame",C);format("layer",A);format("selected",((currentFrame==C)?"true":"false"));if(typeof (DrawCanvas)!=typeof (undefined)&&(DrawCanvas[C])?((DrawCanvas[C].renderer.getMarkup().length>15)?"false":"true"):"true"==false){format("empty","false");setTimeout("timelinePreview("+C+")",Ext.QuickTips.showDelay+5);format("total objects",DrawCanvas[C].renderer.svgRoot.childNodes.length)}else{format("empty","true")}B+="<div id='timPreDiv' class='previewTooltip'><center>No Preview Availiable</center></div>";return B}function timelinePreview(E){if(!frameIsEmpty(E)){if(document.getElementById("timPreDiv")){document.getElementById("timPreDiv").innerHTML="";var F="http://www.w3.org/2000/svg";var D=document.createElementNS(F,"svg");D.setAttribute("viewBox","0 0 480 272");document.getElementById("timPreDiv").appendChild(D);var B=$("richdraw"+E).innerHTML;var A=parseSVG(B).getElementsByTagName("svg")[0];for(var G=0;G<A.childNodes.length;G++){var J=A.childNodes[G];var I=J.attributes;var H=document.createElementNS(F,J.tagName);for(var C=0;C<I.length;C++){H.setAttribute(I[C].nodeName,I[C].value)}document.getElementById("timPreDiv").firstChild.appendChild(H)}}}}function purgeEmpty(){for(var A=0;A<totalFrames;A++){if(frameIsEmpty(A,1)==true){DrawCanvas[A]=null;console.log(A)}}}var canvasNumber=1;var previousCanvas=0;var canvasDisplayStyle="";var canvasIssueResolved=new Boolean();var AnimationPlay=new Boolean();var AnimationFramerate=12;var totalFrames=1;var canvasHeight=272;var canvasWidth=480;var revisionNumber=1;var animationRevision=new Array();var animationRevisionURL=new Array();var lastAnimationURL="";AnimationPlay=true;canvasIssueResolved=false;function makeCanvasFromIE(B){var A;A='<div id="richdraw'+B+'" style="';A+="display:"+canvasDisplayStyle+';height: 100%; width: 100%"></div>';document.getElementById("CanvasContainer").innerHTML+=A;canvasDisplayStyle="none";initDraw(B)}function makeCanvasFromId(B){var A=document.createElement("div");A.setAttribute("id","richdraw"+B);A.setAttribute("style","display:"+canvasDisplayStyle+";height: 100%; width: 100%");document.getElementById("CanvasContainer").appendChild(A);canvasDisplayStyle="none";initDraw(B)}function setCP(){$("CanvasContainer").style.height=canvasHeight+"px";$("CanvasContainer").style.width=canvasWidth+"px";$("zFlashPreviewDiv").style.height=canvasHeight+"px";$("zFlashPreviewDiv").style.width=canvasWidth+"px"}function generateAnimationXML(){DrawCanvas[currentCanvas].unselect();var C="<AnimationXML>";for(var B=1;B<=totalFrames;B++){if(DrawCanvas[B]!=null&&DrawCanvas[B].renderer.getMarkup()!="<svg></svg>"){var A;A=DrawCanvas[B].renderer.getMarkup();C+=A}else{if(isKeyframe(B,1)!=false){C+="<svg></svg>"}else{C+='<svg t="f"></svg>'}}}C+="</AnimationXML>";return C}function initCanvas(){makeCanvasFromIE(1);gotoframe(1,1)}var fGenDir="../freemovie/";function preFlash(){updateRevisionList();$("previewStatus").innerHTML="Mode: Preview (Revision "+(revisionNumber-1)+")";if(animationRevision[revisionNumber-1]==generateAnimationXML()){setTimeout("embedAnimationPreview()",100)}else{$("zFlashPreviewDiv").style.height=canvasHeight+"px";$("zFlashPreviewDiv").style.width=canvasWidth+"px";$("zFlashPreviewDiv").innerHTML="";pButton.disable();pButton.setText("generating...");var A=generateAnimationXML();if(A.length>50){Ext.Ajax.request({url:fGenDir+"swfgen.php",params:{type:"preview",height:canvasHeight,width:canvasWidth,framerate:AnimationFramerate,svg:A},success:function(C){animationRevision[revisionNumber]=generateAnimationXML();var D=fGenDir+C.responseText;lastAnimationURL=D;animationRevisionURL[revisionNumber]=D;revisionNumber++;$("previewStatus").innerHTML="Mode: Preview (Revision "+(revisionNumber-1)+")";var B=genFlashHTML(D);document.getElementById("zFlashPreviewDiv").innerHTML=B;pButton.enable();pButton.setText("Preview");updateRevisionList()}})}else{$("zFlashPreviewDiv").innerHTML="Empty Animation"}}$("previewStatus").innerHTML="Mode: Preview (Revision "+(revisionNumber-1)+")"}function genFlash(){Ext.MessageBox.prompt("Filename","please enter a file name for the animation",function(B,A){if(B!="cancel"){A=A.replace(".swf","");A=escape(A);eButton.disable();eButton.setText("generating...");exportText.getEl().dom.innerHTML="";var C=generateAnimationXML();if(C.length>50){Ext.Ajax.request({url:fGenDir+"swfgen.php",params:{filename:A,type:"export",height:canvasHeight,width:canvasWidth,framerate:AnimationFramerate,svg:C},success:function(D){generateSWFResponse(D.responseText)}})}}else{msg("Export Flash","Canceled")}})}function generateSWFResponse(B){var A=fGenDir+B;exportText.getEl().dom.innerHTML='<a id="zExportURL" href="'+A+">"+A+"</a>";eButton.enable();eButton.setText("Export&nbsp;Animation");exportText.getEl().dom.innerHTML='<a id="zExportURL" href="'+$("zExportURL").href+">"+$("zExportURL").href+"</a>";$("saveIframe").src="../php/saveRedirect.php?url="+A+"&fn="+A.substring(A.lastIndexOf("/")+1)}function genFlashHTML(B){var A="";A='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= ';A+='"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"';A+='WIDTH="'+canvasWidth+'" HEIGHT="'+canvasHeight+'" id="fpre">';A+='<param name="swLiveConnect" value="true" /><param name="allowScriptAccess" value="always" />';A+='<param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" /><PARAM NAME=movie VALUE="'+B+'">';A+='<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="'+B+'" ';A+=' quality=high bgcolor=#FFFFFF WIDTH="'+canvasWidth+'" HEIGHT="'+canvasHeight+'"';A+=' wmode="transparent" id="fpre" swliveconnect="true" allowscriptaccess="always"';A+='NAME="" ALIGN="" TYPE="application/x-shockwave-flash"';A+='PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';return A}function embedAnimationPreview(){$("previewStatus").innerHTML="Mode: Preview (Revision "+(revisionNumber-1)+")";document.getElementById("zFlashPreviewDiv").innerHTML=genFlashHTML(lastAnimationURL)}function updateRevisionList(){previewRevisionStore.removeAll();var B;for(var A=0;A<animationRevision.length;A++){B="Revision: "+A;if(A==animationRevision.length-1){B+=" (HEAD)"}if(A==0){B+=" (Empty)"}previewRevisionStore.add(new historyGrid.dataSource.reader.recordType({revision:B}))}previewRevision.setValue(B)}function getFlashObject(A){if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[A]){return document.embeds[A]}if(window.document[A]){return window.document[A]}}else{return document.getElementById(A)}}function fNext(){getFlashObject("fpre").GotoFrame(parseInt(getFlashObject("fpre").TGetProperty("/",4)))}function fPre(){getFlashObject("fpre").GotoFrame(parseInt(getFlashObject("fpre").TGetProperty("/",4))-2)}function fPlay(){getFlashObject("fpre").Play()}function fStop(){getFlashObject("fpre").StopPlay()}function playAnimation(){AnimationPlay=true;doAnimation()}function doAnimation(){if(totalFrames==1){AnimationPlay=false}if(currentCanvas+1>totalFrames){gotoframe(1,1);setTimeout("doAnimation()",1000/AnimationFramerate)}else{if(AnimationPlay==true){nextFrame();setTimeout("doAnimation()",1000/AnimationFramerate)}}}function replaceAll(D,C,A){var B=new RegExp(D,"g");return A.replace(B,C)}function stopAnimation(){AnimationPlay=false}function hideCurrentCanvas(){try{document.getElementById("richdraw"+currentCanvas).style.display="none"}catch(A){}}function showCurrentCanvas(){try{document.getElementById("richdraw"+currentCanvas).style.display=""}catch(A){}}function parseDiff(F,B){function D(K){return K.tagName.toString().toLowerCase()}var A=B.cloneNode(true);var C=F.cloneNode(true);if(C.childNodes.length==A.childNodes.length){var H=C.childNodes.length;var G=0;for(var E=0;E<C.childNodes.length;E++){var J=C.childNodes[E];var I=A.childNodes[E];if(D(J)==D(I)){if(D(J)=="rect"){if(J.getAttribute("x")==I.getAttribute("x")){if(J.getAttribute("y")==I.getAttribute("y")){G++}}}if(D(J)=="line"){if(J.getAttribute("x1")==I.getAttribute("x1")){if(J.getAttribute("y1")==I.getAttribute("y1")){if(J.getAttribute("x2")==I.getAttribute("x2")){if(J.getAttribute("y2")==I.getAttribute("y2")){G++}}}}}if(D(J)=="ellipse"){if(J.getAttribute("cx")==I.getAttribute("cx")){if(J.getAttribute("cy")==I.getAttribute("cy")){if(J.getAttribute("rx")==I.getAttribute("rx")){if(J.getAttribute("ry")==I.getAttribute("ry")){G++}}}}}}}if(H==G){return"S1"}else{return"D2"}}else{return"D1"}}var autotween=true;function createTween(J,A){if(!autotween){return }if(!DrawCanvas[J]||!DrawCanvas[A]){return }var K=(new DOMParser()).parseFromString(DrawCanvas[J].renderer.getMarkup(),"text/xml").firstChild;var H=(new DOMParser()).parseFromString(DrawCanvas[A].renderer.getMarkup(),"text/xml").firstChild;var C=A-J;if(K.length!=H.length){return }var F=new Array();for(var N=0;N<C;N++){F[N]=K.cloneNode(true)}for(var G=0;G<K.childNodes.length;G++){for(var E=0;E<C;E++){var I=F[E].childNodes[G];if(K.childNodes[G].tagName.toString().toLowerCase()=="rect"){var D=getDist(I,H.childNodes[G],"x")/C;var M=getDist(I,H.childNodes[G],"y")/C;I.setAttribute("x",parseInt(I.getAttribute("x"))+(D*E));I.setAttribute("y",parseInt(I.getAttribute("y"))+(M*E))}if(K.childNodes[G].tagName.toString().toLowerCase()=="ellipse"){var D=getDist(I,H.childNodes[G],"cx")/C;var M=getDist(I,H.childNodes[G],"cy")/C;I.setAttribute("cx",parseInt(I.getAttribute("cx"))+(D*E));I.setAttribute("cy",parseInt(I.getAttribute("cy"))+(M*E))}if(K.childNodes[G].tagName.toString().toLowerCase()=="line"){var B=getDist(I,H.childNodes[G],"x1")/C;var L=getDist(I,H.childNodes[G],"y1")/C;I.setAttribute("x1",parseInt(I.getAttribute("x1"))+(B*E));I.setAttribute("y1",parseInt(I.getAttribute("y1"))+(L*E));I.setAttribute("x2",parseInt(I.getAttribute("x2"))+(B*E));I.setAttribute("y2",parseInt(I.getAttribute("y2"))+(L*E))}}}renderTween(F,J)}function getDist(E,B,A){var D=parseInt(E.getAttribute(A));var C=parseInt(B.getAttribute(A));return C-D}function renderTween(A,B){for(var C=0;C<A.length;C++){loadFrame((new XMLSerializer()).serializeToString(A[C]),C+B)}}function loadFrame(C,A){if(C.indexOf("Error")>0){Ext.log(C)}var E="http://www.w3.org/2000/svg";if(DrawCanvas[A]==null){gotoframeMinimal(A,1)}if(DrawCanvas[A].renderer.svgRoot.hasChildNodes()){while(DrawCanvas[A].renderer.svgRoot.childNodes.length>=1){DrawCanvas[A].renderer.svgRoot.removeChild(DrawCanvas[A].renderer.svgRoot.firstChild)}}var D=parseSVG(C).firstChild;for(var F=0;F<D.childNodes.length;F++){var I=D.childNodes[F];var G=I.attributes;var H=document.createElementNS(E,I.tagName);for(var B=0;B<G.length;B++){H.setAttribute(G[B].nodeName,G[B].value)}DrawCanvas[A].renderer.svgRoot.appendChild(H);Event.observe(H,"mousedown",DrawCanvas[A].onHitListener)}}function parseSVG(B){var D="http://www.w3.org/2000/svg";var A;if(window.ActiveXObject){A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(B)}else{var C=new DOMParser();A=C.parseFromString(B,"text/xml")}return A}var userMode="login";var encPW="";var userName="";var cPrEiD="";var cPrEuN="";var passField;var userField;var fileDS;var pass2Field;var fileLayout;var submitRegister;var submitLogin;if(urlParams["autologin"]=="true"){ajaxanimator.onReady(function(){setTimeout("autoLogin()",1000)})}if(urlParams["autologin"]=="demo"||urlParams["autologin"]=="default"){ajaxanimator.onReady(function(){setTimeout("autoLogin(1)",1000)})}function smartLogin(){if(!urlParams["autologin"]){if(readCookie("RemAnimatorUser")&&readCookie("RemAnimatorPass")){loginUser(readCookie("RemAnimatorUser"),readCookie("RemAnimatorPass"))}}}function autoLogin(A){if(A==1){mainLayout.getRegion("east").showPanel("user-div");loginUser("Username","Password")}else{mainLayout.getRegion("east").showPanel("user-div");if(readCookie("RemAnimatorUser")&&readCookie("RemAnimatorPass")){loginUser(readCookie("RemAnimatorUser"),readCookie("RemAnimatorPass"))}else{loginUser(userField.getValue(),passField.getValue())}}}if(urlParams["autoload"]){ajaxanimator.onReady(function(){setTimeout('loadAnimationFromURL(urlParams["autoload"].split(",")[1],urlParams["autoload"].split(",")[0])',1000)})}function drawFileList(){fileDS=new Ext.data.SimpleStore({fields:["filename"],data:null});var A=new Ext.grid.ColumnModel([{header:"File Name",sortable:true,dataIndex:"filename"}]);fileGrid=new Ext.grid.Grid("userFileList",{ds:fileDS,cm:A,autoSizeColumns:true,monitorWindowResize:true,trackMouseOver:true});fileGrid.render();fileGrid.on("cellclick",function(C,B){loadAnimationFromURL(fileDS.getAt(B)["data"]["filename"]+".xml")});fileLayout=Ext.BorderLayout.create({monitorWindowResize:true,center:{margins:{left:0.1,top:0.1,right:0.1,bottom:0.1},panels:[new Ext.GridPanel(fileGrid)]}},"userFiles");mainLayout.getRegion("east").getPanel("user-div").on("resize",function(){try{fileLayout.layout()}catch(B){}})}function drawLogin(){userField=new Ext.form.TextField({name:"loginUsername",id:"loginUsername",allowBlank:false,value:"Username"});passField=new Ext.form.TextField({name:"loginPassword",inputType:"password",allowBlank:false,value:"Password"});pass2Field=new Ext.form.TextField({name:"registerPassword",inputType:"password",allowBlank:false,value:"Password"});userField.render("userLogin");passField.render("userLogin");pass2Field.render("userLogin");pass2Field.setVisible(false);submitLogin=new Ext.Button("userLogin",{text:"Login",handler:function(){loginUser(userField.getValue(),passField.getValue())}});submitRegister=new Ext.Button("userLogin",{text:"Register",handler:function(){if(passField.getValue()==pass2Field.getValue()){registerUserCred(userField.getValue(),passField.getValue())}else{Ext.MessageBox.alert("Error","Password fields don't match!")}}});submitRegister.setVisible(false)}function renderRegister(){Ext.get("userLogin").slideOut("t",{callback:function(){submitLogin.setVisible(false);submitRegister.setVisible(true);pass2Field.setVisible(true);regbutton.setVisible(false);loginbutton.setVisible(true);Ext.get("userLogin").slideIn()}})}function hideRegister(A){Ext.get("userLogin").slideOut("t",{callback:function(){submitLogin.setVisible(true);submitRegister.setVisible(false);pass2Field.setVisible(false);regbutton.setVisible(true);loginbutton.setVisible(false);Ext.get("userLogin").slideIn();if(A){loginUser(userField.getValue(),passField.getValue())}}})}function loginUser(D,C,A){if(C.length==32){var B=C}else{var B=hex_md5(C)}Ext.Ajax.request({url:"../php/login.php",params:"user="+D+"&pass="+B+"&valid=true&rem=true",success:function(E){if(E.responseText.substr(0,4).indexOf("S")!=-1){msg("Login Status: Successful","Login Successful");encPW=B;userName=D;if(D!="Username"){createCookie("RemAnimatorUser",D);createCookie("RemAnimatorPass",B)}loginSucessful()}else{Ext.MessageBox.alert("Login Status: Error",E.responseText)}},failure:failCon})}function logout(){Ext.get("userLogin").slideIn();Ext.get("userProfile").fadeOut();Ext.get("userFiles").fadeOut();Ext.get("userFileList").fadeOut();Ext.get("userFileList").dom.innerHTML="";encPW="";userName="";regbutton.setVisible(true);logoutbutton.setVisible(false);fileDS=null;fileLayout=null;eraseCookie("RemAnimatorUser");eraseCookie("RemAnimatorPass")}function loginSucessful(){Ext.get("userLogin").slideOut("t",{duration:1,callback:function(){$("userLogin").style.display="none"}});Ext.get("userProfile").fadeIn();Ext.get("userFiles").fadeIn();Ext.get("userFileList").fadeIn();animationList();regbutton.setVisible(false);logoutbutton.setVisible(true);if(userName=="Username"){userMessage.setText("Welcome&nbsp;"+userName+"(demo)")}else{userMessage.setText("Welcome&nbsp;"+userName)}userMessage.enable()}function registerUserCred(A,B){Ext.Ajax.request({url:"../php/register.php",params:"user="+A+"&pass="+B+"&valid=true",failure:failCon,success:function(C){if(C.responseText.substr(0,3).indexOf("S")!=-1){Ext.MessageBox.alert("Registration Status","Registration Sucessful",function(){hideRegister(true)})}else{Ext.MessageBox.alert("Registration Status",C.responseText.substr(4).replace(":",""))}}})}function savetoserver(){if($("userProfile").style.display==""){var A=axml2();Ext.MessageBox.prompt("Animation Name","Set a Name For Animation",function(B,C){Ext.Ajax.request({url:"../php/savetoserver.php",params:"user="+userName+"&pass="+encPW+"&data="+A+"&name="+C,failure:failCon,success:function(D){if(D.responseText.substr(0,3).indexOf("E")!=-1){msg("Save Status","Error! Account Not Valid")}else{msg("Save Status","Save Sucessful")}animationList()}})})}else{Ext.MessageBox.alert("Error:","Please Login or Register First")}}function animationList(){if(userName!=""){Ext.Ajax.request({url:"../php/listAnimations.php",params:"user="+userName,success:function(C){if(!fileDS){drawFileList()}fileDS.removeAll();var B=C.responseText.split(",");var E="";for(var A=0;A<B.length-1;A++){var D=B[A].replace(".xml","");fileDS.add(new historyGrid.dataSource.reader.recordType({filename:D}))}},failure:failCon})}else{Ext.MessageBox.alert("Error:","Please Login First")}}function loadAnimationFromURL(A,B){Ext.Ajax.request({url:"../users/"+((B)?B:userName)+"/animations/"+A,success:function(C){loadAXML(C.responseText)}})}var keyShortcuts;ajaxanimator.onReady(function(){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){var C=A[B];C.hasFocus=false;C.onfocus=function(){keyShortcuts.disable()};C.onblur=function(){keyShortcuts.enable()}}});function showKeyGuide(){var A="";var B=function(C){A+=C;A+="\n<br>"};B("Ctrl+C : Copy Selected Object");B("Ctrl+V : Paste Object");B("Ctrl+Z : Undo Action");B("Ctrl+S : Open Save/Open window");B("-> (right arrow key) : Next Frame");B("Page Down : Next Frame");B("<- (left arrow key) : Previous Frame");B("Page Up : Previous Frame");B("P : Play Animation (within canvas)");B("S : Stop Animation Playback (within canvas)");B("Delete : Delete Selected Object (or delete frame if nothing is selected)");B("R : Clear Current Frame");B("F6: To Keyframe");Ext.MessageBox.alert("Keyboard Shortcuts:",A)}ajaxanimator.onReady(function(){keyShortcuts=new Ext.KeyMap(document,[{key:"c",ctrl:true,fn:function(){copyObj()}},{key:"v",ctrl:true,fn:function(){pasteObj()}},{key:"z",ctrl:true,fn:function(){undo()}},{key:[39,33],fn:function(){nextFrame()}},{key:[37,34],fn:function(){preFrame()}},{key:117,fn:function(){toKeyframe()}},{key:"p",fn:function(){playAnimation()}},{key:"s",ctrl:false,fn:function(){stopAnimation()}},{key:46,fn:function(){if(DrawCanvas[currentCanvas].selected!=null){deleteShape()}else{removeKeyframe()}}},{key:82,fn:function(){removeKeyframe()}},{key:"s",ctrl:true,stopEvent:true,fn:function(){showFileSystemDialog()}}])});ajaxanimator.onReady(function(){$("fillcolor").style.backgroundImage="url('"+imgURL+"/bucket.png')";$("linecolor").style.backgroundImage="url('"+imgURL+"/pencil.png')";$("fillcolor").style.backgroundColor="#ff0000";$("linecolor").style.backgroundColor="#000000";var A=new Array("select|select.gif","rect|rectangle.gif","roundrect|roundrect.gif","ellipse|circle.gif","line|line.gif","delete|delete.gif");var G=document.getElementById("tbIcon");var D=document.createElement("table");var B=document.createElement("tbody");var F=0;for(var L=0;L<3;L++){var K=document.createElement("tr");for(var J=0;J<2;J++){var M=document.createElement("td");var C=A[F].split("|");F++;var H=document.createElement("div");H.id=C[0];H.className="toolbarItem";var E=document.createElement("div");E.className="centerVertical";var I=document.createElement("img");I.src=imgURL+"/"+C[1];I.className="toolbarItem";E.appendChild(I);H.appendChild(E);M.appendChild(H);K.appendChild(M)}B.appendChild(K)}D.appendChild(B);G.appendChild(D)});var drawTools=new Object();drawTools.select=function(){setMode("select","Selection")};drawTools.rect=function(){setMode("rect","Rectangle")};drawTools.roundrect=function(){setMode("roundrect","Rounded Rectangle")};drawTools.ellipse=function(){setMode("ellipse","Ellipse / Circle")};drawTools.line=function(){setMode("line","Line")};ajaxanimator.onReady(function(){iconId=new Array("select","rect","roundrect","ellipse","line","delete");for(var B=0;B<iconId.length;B++){(function(C){Ext.get(C).on("mouseover",function(){if($(C).style.backgroundImage.indexOf("selectedMask")==-1){$(C).style.backgroundImage="url("+imgURL+"/buttonMask.png)"}});Ext.get(C).on("mouseout",function(){if($(C).style.backgroundImage.indexOf("buttonMask")!=-1){$(C).style.backgroundImage=""}});Ext.get(C).on("click",function(){if(C=="delete"){changeSelectedUI("delete");deleteShape();setTimeout("drawTools.select();",100)}else{drawTools[C]()}})})(iconId[B])}Ext.QuickTips.register({target:"select",text:"Select Tool",trackMouse:true});Ext.QuickTips.register({target:"rect",text:"Rectangle Draw Tool",trackMouse:true});Ext.QuickTips.register({target:"roundrect",text:"Rounded Rectangle Draw Tool",trackMouse:true});Ext.QuickTips.register({target:"ellipse",text:"Ellipse/Circle Draw Tool",trackMouse:true});Ext.QuickTips.register({target:"line",text:"Line Draw Tool",trackMouse:true});Ext.QuickTips.register({target:"delete",text:"Delete Selected Object",trackMouse:true});var A=new Ext.data.SimpleStore({fields:["size"],data:[["1px"],["2px"],["3px"],["4px"],["5px"],["6px"],["7px"],["8px"],["9px"],["10px"],["11px"],["12px"],["13px"],["14px"]]});lineWidth=new Ext.form.ComboBox({store:A,displayField:"size",typeAhead:true,grow:true,mode:"local",value:"1px",triggerAction:"all",minLength:1,selectOnFocus:true,resizable:true});lineWidth.on("select",function(C){setLineWidth()});lineWidth.applyTo("linewidth");lineWidth.setSize(lineWidth.container.getWidth())});ajaxanimator.onReady(function(){editControlToolbar("canvasControlBar",1)});function editControlToolbar(A,B){if($(A)){if(!$(A).firstChild){Ext.get("TpreFrame").on("click",function(D){if(mainLayout.getRegion("center").activePanel.getId()=="canvas-div"){preFrame()}else{fPre()}});Ext.get("TnxtFrame").on("click",function(D){if(mainLayout.getRegion("center").activePanel.getId()=="canvas-div"){nextFrame()}else{fNext()}});Ext.get("TplayAnim").on("click",function(D){if(mainLayout.getRegion("center").activePanel.getId()=="canvas-div"){playAnimation()}else{fPlay()}});Ext.get("TstopAnim").on("click",function(D){if(mainLayout.getRegion("center").activePanel.getId()=="canvas-div"){stopAnimation()}else{fStop()}});var C=document.createElement("img");C.usemap="#ControlMap";C.setAttribute("usemap","#ControlMap");C.src=imgURL+"/controlToolbar.png";$(A).appendChild(C)}}}var iconId;var lineWidth;function setLayerData(){DrawLayer[currentLayer]=DrawCanvas}function setLayer(A){currentLayer=A;DrawCanvas=DrawLayer[currentLayer]}function initDraw(C){var A=C?C:currentCanvas;var B=new SVGRenderer();DrawCanvas[A]=new RichDrawEditor(document.getElementById("richdraw"+A),B);DrawCanvas[A].onselect=onSelect;DrawCanvas[A].onunselect=onUnselect;$("CanvasContainer").onmouseup=function(){checkEdit();setSD()};if(totalFrames==1){setCanvasDefaults()}else{setCanvasProperties()}isinit=true;setLayerData()}function refreshModeData(){if(DrawCanvas[currentCanvas]){DrawCanvas[currentCanvas].editCommand("mode",zCurrentCanvasMode)}setTimeout("refreshModeData()",1000)}function setCanvasDefaults(){DrawCanvas[currentCanvas].editCommand("fillcolor","rgb(255,0,0)");DrawCanvas[currentCanvas].editCommand("linecolor","rgb(0,0,0)");DrawCanvas[currentCanvas].editCommand("linewidth","1px");setMode("rect","Rectangle");$("fillcolor").style.backgroundColor="rgb(255,0,0)";$("linecolor").style.backgroundColor="rgb(0,0,0)"}function setCanvasProperties(){DrawCanvas[currentCanvas].editCommand("fillcolor",$("fillcolor").style.backgroundColor);DrawCanvas[currentCanvas].editCommand("linecolor",$("linecolor").style.backgroundColor);var A=lineWidth.value;DrawCanvas[currentCanvas].editCommand("linewidth",A);DrawCanvas[currentCanvas].editCommand("mode",zCurrentCanvasMode)}function changeSelectedUI(B){if(iconId){for(var A=0;A<iconId.length;A++){$(iconId[A]).style.backgroundImage=""}$(B).style.backgroundImage="url("+imgURL+"/selectedMask.png)"}}function setMode(B,A){changeSelectedUI(B);DrawCanvas[currentCanvas].editCommand("mode",B);zCurrentCanvasMode=B;if(B=="select"){$("status").innerHTML="Mode: Select/Move"}else{$("status").innerHTML="Mode: Draw "+A}}function deleteShape(){if(DrawCanvas[currentCanvas].selected){DrawCanvas[currentCanvas].deleteSelection();addHistory("Delete Shape")}}function setFillColor(A){DrawCanvas[currentCanvas].editCommand("fillcolor",A)}function setLineColor(A){DrawCanvas[currentCanvas].editCommand("linecolor",A)}function setLineWidth(){var A=lineWidth.value;DrawCanvas[currentCanvas].editCommand("linewidth",A)}function showMarkup(){alert(value=DrawCanvas[currentCanvas].renderer.getMarkup())}function onSelect(){setLayerData();$("fillcolor").style.backgroundColor=DrawCanvas[currentCanvas].queryCommand("fillcolor");$("linecolor").style.backgroundColor=DrawCanvas[currentCanvas].queryCommand("linecolor");lineWidth.setValue(DrawCanvas[currentCanvas].queryCommand("linewidth"))}function onUnselect(){setLayerData();$("fillcolor").style.backgroundColor=DrawCanvas[currentCanvas].queryCommand("fillcolor");$("linecolor").style.backgroundColor=DrawCanvas[currentCanvas].queryCommand("linecolor");lineWidth.setValue(DrawCanvas[currentCanvas].queryCommand("linewidth"))}function confirmNewCanvas(){Ext.Msg.confirm("Warning","Creating a new animation will erase everything on the canvas. Continue?",function(A){if(A=="yes"){resetDefaults()}})}function resetDefaults(B){var A=false;if(typeof (B)=="object"){A=true}function C(D){if(A){if(typeof (B["no"+D])=="boolean"){if(B["no"+D]==true){return false}else{return true}}}return true}$("CanvasContainer").innerHTML="";$("frameContainer").innerHTML="";keyframeArray=new Array();tweenArray=new Array();tweenRecalc=new Array();currentFrame=1;currentLayer=1;totalFrames=1;layerMaxFrames=300;layerCount=0;frameTable=null;if(C("history")){resetHistory()}if(C("revision")){revisionNumber=1;animationRevision=new Array();animationRevisionURL=new Array();lastAnimationURL=""}DrawLayer=new Array();DrawCanvas=new Array();zCurrentCanvasMode="rect";if(C("history")){editHistoryNumber=0;editHistory=new Array()}if(C("clipboard")){clipboardTagStr="";clipboardAtt=null}currentCanvas=1;AnimationPlay=false;addLayer();initCanvas()}function setSD(){if(DrawCanvas[currentCanvas].mode=="select"&&DrawCanvas[currentCanvas].selected!=null){$("ResizeObjOpt").style.display="";$("noSelectRem").style.display="none";$("sHeight").value=DrawCanvas[currentCanvas].selected.attributes["height"].nodeValue;$("sWidth").value=DrawCanvas[currentCanvas].selected.attributes["width"].nodeValue}else{$("ResizeObjOpt").style.display="none";$("noSelectRem").style.display=""}}function setSP(){DrawCanvas[currentCanvas].selected.attributes["width"].nodeValue=$("sWidth").value;DrawCanvas[currentCanvas].selected.attributes["height"].nodeValue=$("sHeight").value;DrawCanvas[currentCanvas].renderer.showTracker(DrawCanvas[currentCanvas].selected)}function openfromcomputer(){Ext.MessageBox.show({title:"Open Project File",msg:'<form enctype="multipart/form-data" id="uploadForm" target="uploadIframe" action="../php/upload.php" method="post"><input name="uploaded" type="file"></form>',buttons:Ext.MessageBox.OKCANCEL,width:250,fn:function(A){if(A=="ok"){Ext.get("uploadForm").dom.submit();Ext.MessageBox.progress("Loading Animation From Computer","Initializing...");Ext.MessageBox.updateProgress(0.4,"Uploading...")}else{msg("Cancelled","Upload Cancelled!")}}})}function finishUpload(){Ext.MessageBox.updateProgress(0.8,"Downloading...");var A=uploadIframe.document.body.innerHTML;var B=A.substr(0,A.indexOf("UPLOADDATAEND"));Ext.MessageBox.hide();loadAXML(B)}function savetotext(){Ext.Msg.alert("Save Animation As Text","<textarea style='width:100%;height:250px'>"+axml2()+"</textarea>")}function openfromtext(){Ext.MessageBox.prompt("Load Animation From Text","",function(B,A){if(B=="ok"){loadAXML(A)}else{msg("Cancelled","Animation Loading Cancelled")}},null,250)}function saveAnimation(){Ext.MessageBox.prompt("Filename","please enter a file name for the animation",function(C,B){if(C=="ok"){if(B.length>2){var A=document.createElement("form");A.action="../php/virtualSave.php";A.method="POST";A.target="saveIframe";var D=document.createElement("textarea");D.name="content";D.value=axml2();var E=document.createElement("input");E.type="text";E.name="fn";E.value=B;A.appendChild(D);A.appendChild(E);$("miscDiv").appendChild(A);A.submit();$("miscDiv").removeChild(A)}else{window.location=dataUrl(axml2(),"application/ajaxanimator")}}})}var DrawLayer=new Array();var DrawCanvas=new Array();var zCurrentCanvasMode="rect";var editHistoryNumber=0;var editHistory=new Array();var clipboardTagStr="";var clipboardAtt=null;var Colorobj=null;var picker=null;var historyLayout;var AnimationPlay=false;var currentCanvas=1;var statArray=new Object();statArray["referrer"]=document.referrer;statArray["title"]=document.title;statArray["location2"]=document.location;statArray["location1"]=window.location;statArray["date"]=(new Date()).toString();statArray["useragent"]=window.userAgent;statArray["appversion"]=navigator.appVersion;statArray["useragent"]=navigator.userAgent;statArray["vendor"]=navigator.vendor;statArray["platform"]=navigator.platform;statArray["screenwidth"]=screen.width;statArray["screenheight"]=screen.height;statArray["historylength"]=history.length;statArray["plugins"]=navigator.plugins.length;statArray["cookielength"]=document.cookie.length;var paramString="";for(x in statArray){paramString+="&"+x+"="+escape(statArray[x])}paramString=paramString.substring(1);function sendStats(){getFilePOST("../stats/load.php",paramString)}function getFilePOST(A,B){if(window.XMLHttpRequest){AJAX=new XMLHttpRequest()}else{AJAX=new ActiveXObject("Microsoft.XMLHTTP")}if(AJAX){AJAX.open("POST",A,false);AJAX.setRequestHeader("Content-type","application/x-www-form-urlencoded");AJAX.send(B);return AJAX.responseText}else{return false}}var startime=(new Date()).getTime();window.onunload=function(){var A=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();A.open("GET","../stats/count.php?t="+(((new Date()).getTime()-startime)/1000),true);A.send(null)};var igt;var iga;var tutorial;var cftid;var cHelpFunc;function calcHelpAction(A){canceltutorial.setVisible(true);if(A){if(!igt||!iga){iga=document.createElement("img");iga.src="../images/arrow2.png";iga.style.zIndex="99999";iga.style.position="absolute";iga.style.display="none";document.body.appendChild(iga);igt=document.createElement("div");igt.style.zIndex="99999";igt.style.position="absolute";igt.style.display="none";document.body.appendChild(igt)}cftid=0;if(typeof (A)==typeof ("String")){tutorial=Ext.util.json.decode(A)}else{tutorial=A}Ext.MessageBox.alert(tutorial.title,tutorial.msg,function(E){if(E=="ok"){calcHelpAction()}else{msg("Interactive Tutorial","Cancelled")}});return }if(typeof (tutorial)=="object"){if(!tutorial.content[cftid]){canceltutorial.setVisible(false);Ext.MessageBox.alert(tutorial.finishTitle,tutorial.finishMsg);return }var D;if(typeof (tutorial.content[cftid].el)==typeof ("string")){D=tutorial.content[cftid].el}else{D=tutorial.content[cftid].el()}if(!Ext.get(D)){setTimeout("calcHelpAction()",1000);return }Ext.get(iga).fadeIn();igt.innerHTML=makeBox("tutorial",tutorial.content[cftid].msg);Ext.get(igt).fadeIn();Ext.get(iga).moveTo(Ext.get(D).getX()+10,Ext.get(D).getY()+10,true);Ext.get(igt).moveTo(Ext.get(D).getX()+110,Ext.get(D).getY()+10,true);for(var B=0;B<5;B++){if(tutorial.content[cftid].anim=="fade"){Ext.get(D).fadeOut();Ext.get(D).fadeIn()}else{Ext.get(D).highlight(tutorial.content[cftid].color)}}var C=function(){Ext.get(document.body).un("mouseup",C);Ext.get(iga).fadeOut();Ext.get(igt).fadeOut();cftid++;setTimeout("calcHelpAction()",2000)};Ext.get(document.body).on("mouseup",C)}else{if(tutorial=="cancel"){canceltutorial.setVisible(false);msg("Interactive Tutorial","Cancelled")}}}function basictutorial2(){var A={title:"Interactive Tutorial",msg:"Welcome To the Ajax Animator Basic Tutorial V0.3 Alpha<br>Press 'Ok' to continue",finishTitle:"Finished Tutorial",finishMsg:"Congratulations, You have sucessfully completed the ajax animator beginner interactive tutorial version 0.3 Alpha",content:[{el:"fillcolor",msg:"Press The Fill Color Icon to select object background color"},{el:function(){return Ext.select(".color-99CCFF").elements[0]},msg:"Select Color",anim:"fade"},{el:function(){return Ext.select(".x-dlg-close").elements[0]},msg:"Close Dialog",anim:"fade"},{el:"CanvasContainer",msg:"Draw Object"},{el:"frame30layer1",msg:"Go To Frame 30"},{el:"select",msg:"Use 'select' tool"},{el:"CanvasContainer",msg:"Move Object"},{el:function(){return mainLayout.getRegion("center").tabs.items[1].textEl.id},msg:"Preview Animation",anim:"fade"}]};if(generateAXML2(true).length>50){Ext.Msg.confirm("Warning","Starting the tutorial will erase everything on the canvas. Continue?",function(B){if(B=="yes"){calcHelpAction(A)}else{msg("Cancelled","Tutorial Cancelled")}})}else{calcHelpAction(A)}}function showAbout(){Ext.MessageBox.alert("About Ajax Animator 0.1x","This application was coded entirely by Antimatter15 with the exception of the frameworks/scripts/libraries usedsuch as ExtJS 1.1, Prototype, Richdraw, MD5, Ext Color Picker, also the ones that are no longer includedin the application such as DHTML Suite, Dynamic Drive Tooltips/Ajax, wz_tooltip, YUI, rico, nifty cube,script.aculo.us, prototype windows, dhtmlgoodies color picker, and brainjar menu.")}var fontLibrary={};function textgui(){Ext.MessageBox.prompt("Text","Font Name (case sensitive: Original, FontSwif, DOTS or lwrc)",function(B,A){Ext.MessageBox.prompt("Text","Font Size",function(C,D){Ext.MessageBox.prompt("Text","Enter Text",function(E,F){Ext.MessageBox.prompt("Text","Upper Starting Point (X,Y Format)",function(H,G){addText(F,parseInt(D),parseInt(G.split(",")[0]),parseInt(G.split(",")[1]),A)})})})})}function loadFont(A,B){if(fontLibrary[A]){B(fontLibrary[A])}else{Ext.Ajax.request({url:"../php/loadFont.php",params:{fontname:A},success:function(C){fontLibrary[A]=Ext.util.JSON.decode(C.responseText);if(!fontLibrary[A][" "]){fontLibrary[A][" "]=[]}B(fontLibrary[A])}})}}function listInstalledFonts(){Ext.Ajax.request({url:"../php/loadFont.php",params:{opt:"list"},success:function(A){Ext.MessageBox.alert("Installed Fonts:",A.responseText)}})}function addText(E,D,C,A,B){loadFont(B,function(F){for(var G=0;G<E.split("").length;G++){if(F[E.split("")[G]]){addLetter(F[E.split("")[G]],D,C+(D*6*G),A)}else{addLetter(F["?"],D,C+(D*6*G),A)}}frameCheckEdit()})}function addLetter(B,E,C,A){for(var D=0;D<B.length;D++){macro.addshape({shape:"rect",fill:"rgb(255,0,0)",stroke:"rgb(0,0,0)",strokewidth:1,height:E,width:E,x:C+E*B[D][0],y:A+E*B[D][1]})}}ajaxanimator.onReady(function(){historyDS=new Ext.data.SimpleStore({fields:["number","action"],data:[["0","New Animation"]]});var A=new Ext.grid.ColumnModel([{header:"#",sortable:true,dataIndex:"number"},{header:"Action",sortable:true,dataIndex:"action"}]);historyGrid=new Ext.grid.Grid("HistoryContainer",{ds:historyDS,cm:A,autoSizeColumns:true,monitorWindowResize:true,trackMouseOver:true});historyGrid.render();historyGrid.on("cellclick",function(C,B){revertRevision(B)});historyLayout=Ext.BorderLayout.create({monitorWindowResize:true,center:{margins:{left:0.1,top:0.1,right:0.1,bottom:0.1},panels:[new Ext.GridPanel(historyGrid)]}},"HistoryLayout");mainLayout.getRegion("east").getPanel("history-div").on("resize",function(){historyLayout.layout()})});function resetHistory(){editHistory=new Array();editHistoryNumber=0;historyDS.removeAll()}function revertRevision(A){if(typeof (editHistory[A])=="object"){resetDefaults({nohistory:true,norevision:true,noclipboard:true});axml2read(editHistory[A].axmrec);updateHist();addHistory("Revert to "+A)}else{msg("Error!","You have selected an un-revertable edit!")}}function addHistory(B){var A={action:B,number:editHistoryNumber};historyDS.add(new historyGrid.dataSource.reader.recordType(A))}function undo(){revertRevision(editHistoryNumber-1)}function checkEdit(C){if(histCheck()){updateHist();if(DrawCanvas[currentCanvas].mode!="select"){var B=DrawCanvas[currentCanvas].mode;var A="";switch(B){case"rect":A="Rectangle";break;case"roundrect":A="Rectangle";break;case"ellipse":A="Ellipse";break;case"line":A="Line";break}addHistory("Add&nbsp;"+A)}else{addHistory("Select/Move")}}frameCheckEdit()}function addHist(A){if(histCheck()){updateHist();addHistory(A)}}function updateHist(){editHistoryNumber++;editHistory[editHistoryNumber]={cFrame:currentCanvas,fCount:DrawCanvas[currentCanvas].renderer.svgRoot.childNodes.length,mkup:DrawCanvas[currentCanvas].renderer.getMarkup(),axmrec:axml2()}}function histCheck(){if(!editHistory[editHistoryNumber]){return true}if(currentCanvas!=editHistory[editHistoryNumber].cFrame){return true}if(DrawCanvas[currentCanvas].renderer.svgRoot.childNodes.length!=editHistory[editHistoryNumber].fCount){return true}if(DrawCanvas[currentCanvas].renderer.getMarkup()!=editHistory[editHistoryNumber].mkup){return true}return false}var axmlversion=2.11;function checkAXMLVersion(C){var A=unescape(C);if(A.replace(/ /g,"").indexOf("<")<3&&A.replace(/ /g,"").indexOf("<")>-1){return 1}var B=Ext.util.JSON.decode(A.split(";;")[0]);if(B){if(!B.version){if(!B.v){return 2.01}else{return B.v}}else{return B.version}}else{return"unknown"}}function loadAXML(B,C){function A(){if(checkAXMLVersion(B)!="unknown"){resetDefaults();if(checkAXMLVersion(B)<2){msg("Warning!","Attempting Backwards Compatability Mode");axml1read(B)}else{axml2read(B)}}else{msg("Error","Unknown/Invalid Project File")}}if(checkAXMLVersion(B)>axmlversion){Ext.MessageBox.alert("Error!","You are trying to open a file created by a newer version of this application!");return }if(generateAXML2(true).length>50&&!C){Ext.Msg.confirm("Warning","Opening an animation will erase everything on the canvas. Continue?",function(D){if(D=="yes"){A()}})}else{A()}}function axmJSONDecL1(A){var B=Ext.util.JSON.decode(A);tweenArray=generateTweenArray(B.twn);keyframeArray=B.kf.split(":");canvasHeight=B.res.split("x")[1];canvasWidth=B.res.split("x")[0];totalFrames=B.tf;setCP();AnimationFramerate=B.fr;tweenRecalc=B.twn.split(":")}function axmJSONDecL2(A){var B=Ext.util.JSON.decode(A);gotoframe(B.vis.split(",")[0],B.vis.split(",")[1])}function axml2read(F){F=repDeflate(unescape(F));var E=F.split(";;")[0];var D=decompressAXML2(F.split(";;")[1]);var C=parseSVG(D);for(var A=0;A<C.firstChild.childNodes.length;A++){if(!DrawCanvas[A+1]){makeCanvasFromId(A+1)}loadFrame((new XMLSerializer()).serializeToString(C.firstChild.childNodes[A]),A+1)}axmJSONDecL1(E);for(var B=0;B<C.firstChild.childNodes.length;B++){gotoframeUI(B+1,1)}recalculateTweens();axmJSONDecL2(E)}function generateTweenArray(E){var D=new Array();for(var B=0;B<E.split(":").length;B++){var C=E.split(":")[B].split(",")[0];var A=E.split(":")[B].split(",")[1];for(var F=1;F<(A-C);F++){D.push((parseInt(F)+parseInt(C))+",1")}}return D.unique()}function decompressTweens(A){while(A.indexOf("-esg")!=-1){var B=A.match(new RegExp("-esg....","g"))[0].substr(4);while(B.substr(0,1)=="0"){B=B.substr(1)}var D=parseInt(B);var C="";while(D>0){C+="<svg></svg>";D--}A=A.replace(new RegExp(A.match(new RegExp("-esg....","g"))[0],"g"),C)}return A}function decompressAXML2(A){return decompressTweens(A)}function repDeflate(A){A=escape(A);function B(C,D){A=A.replace((new RegExp(escape(D),"g"))," "+C)}B("stroke=","se=");B("fill=","fl=");B("height=","hg=");B("stroke-width=","sw=");return unescape(A)}function axml2(A){return repCompress(axmljsongen(A)+";;"+generateAXML2(A))}function axmljsongen(B){var C={res:canvasWidth.toString()+"x"+canvasHeight.toString(),fr:AnimationFramerate,twn:tweenRecalc.unique().join(":"),kf:keyframeArray.unique().join(":"),tf:totalFrames,vis:(currentFrame+","+currentLayer),v:axmlversion};var A=Ext.util.JSON.encode(C);if(!B){return axmJSONCompress(C,A)}else{return A}}function axmJSONCompress(B,A){for(x in B){A=A.replace('"'+x.toString()+'"',x.toString())}return A}function generateAXML2(B){DrawCanvas[currentCanvas].unselect();var A="<Ax>";var C=0;for(var E=1;E<=totalFrames;E++){if(!frameIsEmpty(E,1)&&!isTween(E,1)){if(C>0){var D=C.toString();while(D.length<4){D="0"+D}if(D>0){A+="-esg"+D}C=0}A+=DrawCanvas[E].renderer.getMarkup()}else{if(!B){C++}else{A+="<svg></svg>"}}}A+="</Ax>";if(!B){A=AXMLCompress(A)}return escapeAXML(A)}function escapeAXML(B){var A=B;A=escape(A);A=A.replace(/%3E/g,escape("%3E"));A=A.replace(/%3C/g,escape("%3C"));return unescape(A)}function AXMLCompress(A){var F=escape(A);function B(H,I){if(!I){I=""}F=F.replace(new RegExp(escape(H),"g"),escape(I))}function C(H){B("></"+H+">"," />")}B('style="position: absolute;"');C("line");C("rect");C("ellipse");A=unescape(F);var G=A;for(var E=0;E<A.split("rgb(").length;E++){G=G.substr(G.indexOf("rgb(",E));var D=G.substr(0,G.indexOf(")")+1);A=A.replace(D,D.replace(/ /g,""))}A=A.replace(/  /g," ");A=A.replace(/  /g," ");A=A.replace(/  /g," ");A=A.replace(/px/g,"");return A}function repCompress(A){A=escape(A);function B(C,D){A=A.replace((new RegExp(escape(C),"g")),D)}B("stroke=","se=");B("fill=","fl=");B("height=","hg=");B("stroke-width=","sw=");return unescape(A)}function axml1read(B,H){var I=unescape(B);var G=parseSVG(I);var D=new Array();var F="";for(var E=0;E<G.getElementsByTagName("svg").length;E++){D.push((new XMLSerializer()).serializeToString(G.getElementsByTagName("svg")[E]));F+=":"+(E+1)+",1"}var C={res:"480x272",fr:12,twn:"",kf:F.substr(1),tf:D.length,vis:"1,1",v:2.04};var A=Ext.util.JSON.encode(C)+";;<Ax>"+D.join("")+"</Ax>";if(!H){axml2read(A)}return A}Array.prototype.unique=function(A){var C=[],D,B=this.length;for(D=0;D<B;D++){if(C.indexOf(this[D],0,A)<0){C.push(this[D])}}return C};var msgCt;function msg(B,A){if(!msgCt){msgCt=Ext.DomHelper.insertFirst(document.body,{id:"msg-div"},true)}msgCt.alignTo(document,"t-t");Ext.DomHelper.append(msgCt,{html:makeBox(B,A)},true).slideIn("t").pause(2).ghost("t",{remove:true})}function makeBox(B,A){return(['<div class="msg">','<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>','<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>',B,"</h3>",A,"</div></div></div>",'<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',"</div>"].join(""))}function fixSpeed(){keyframeArray=keyframeArray.unique();tweenArray=tweenArray.unique()}function clearPreviews(){Ext.Ajax.request({url:"../freemovie/clearPreviews.php",success:function(A){Ext.MessageBox.alert("Emptying Previews",x.responseText)}})}function failCon(){Ext.MessageBox.alert("Error:","Connection to server failed. Try Again Later. This might because of server misconfiguration, faulty connection, browser misconfiguration, or server traffic")}function dataUrl(data,mimeType){encType=(!!btoa)?";base64":"";var esc=(!!encType)?function(d){return btoa(d)}:function(d){return escape(d)};if(!mimeType){mimeType=(data.nodeName)?"text/html":"text/plain"}b="data:"+mimeType+";charset="+document.characterSet+encType+",";if("string number date boolean function".indexOf(typeof data)>-1){b+=esc(data.toString());return b}if(data.constructor==Array){b+=esc(data.join(""));return b}if(typeof data=="xml"){b+=esc(data.toSource());return b}if(typeof data=="object"){if(!!data.value&&!!data.value.length){b+=esc(data.value);return b}if(!!data.innerHTML){b+=esc(data.innerHTML);return b}if(!!data.length){var G=function(ob){r=[];i=0;for(i;i<ob.length;i++){if(dataUrl(ob[i])){r[i]=dataUrl(ob[i])}}return r.join("\n")};return(b+G(data))}if(!!eval(data.toSource())){b+=esc(data.toSource());return b}}return }function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function eraseCookie(A){createCookie(A,"",-1)}function copyObj(){if(DrawCanvas[currentCanvas].selected==null){msg("Error!","Please Select an Object First")}else{clipboardTagStr=DrawCanvas[currentCanvas].selected.tagName;clipboardAtt=DrawCanvas[currentCanvas].selected.attributes}}function pasteObj(){if(clipboardTagStr&&clipboardAtt){try{var D="http://www.w3.org/2000/svg";var A=document.createElementNS(D,clipboardTagStr);for(var C=0;C<clipboardAtt.length;C++){A.setAttribute(clipboardAtt[C].nodeName,clipboardAtt[C].value)}DrawCanvas[currentCanvas].renderer.svgRoot.appendChild(A);Event.observe(A,"mousedown",DrawCanvas[currentCanvas].onHitListener)}catch(B){alert(B)}}else{msg("Error!","Empty Clipboard")}}function IEMessage(){var B="Sorry, your browser is unsupported by the Ajax Animator. This is due to your browser's complete lack of standards compliance. More Technically speaking, your browser is incapable of several DOM Function such as createElementNS and has total lack of support for the SVG format, the vector graphics display for all the editing/playback in this application. The application will go to a reduced functionality mode that will give you a partial demonstration of the user interface organization, with little to no productive functionality, if you would like to be able to use the application, please download and install a standards compliant and somewhat decent browser, such as Mozilla Firefox, Safari 3 Beta+, or Opera.";Ext.MessageBox.alert("Sorry, Your Browser Is Not Supported",B);var A="<center>Sorry! Interent Explorer Is Not Supported! Your browser does not support SVG Graphics</center>";$("CanvasContainer").innerHTML+=A}function randomRect(){var H="http://www.w3.org/2000/svg";var G=Math.round(Math.random()*255);var C=Math.round(Math.random()*255);var D=Math.round(Math.random()*255);var F=Math.round(Math.random()*255);var A=Math.round(Math.random()*255);var B=Math.round(Math.random()*255);var E=document.createElementNS(H,"rect");E.setAttribute("stroke-width",Math.random()*10);E.setAttribute("stroke","rgb("+G+","+C+","+D+")");E.setAttribute("fill","rgb("+F+","+A+","+B+")");E.setAttribute("height",Math.random()*100);E.setAttribute("width",Math.random()*100);E.setAttribute("y",Math.random()*272);E.setAttribute("x",Math.random()*480);DrawCanvas[currentCanvas].renderer.svgRoot.appendChild(E);Event.observe(E,"mousedown",DrawCanvas[currentCanvas].onHitListener)}function randRectArr(){for(var B=0;B<30;B++){for(var A=0;A<10;A++){randomRect()}gotoframe(B,1);removeKeyframe()}}var macro={addshape:function(A){var B=document.createElementNS("http://www.w3.org/2000/svg",A.shape);if(A.strokewidth){B.setAttribute("stroke-width",A.strokewidth)}if(A.fill){B.setAttribute("fill",A.fill)}if(A.stroke){B.setAttribute("stroke",A.stroke)}if(A.width){B.setAttribute("width",A.width)}if(A.height){B.setAttribute("height",A.height)}if(A.x){B.setAttribute("x",A.x)}if(A.y){B.setAttribute("y",A.y)}if(A.x1){B.setAttribute("x1",A.x1)}if(A.y1){B.setAttribute("y1",A.y1)}if(A.x2){B.setAttribute("x2",A.x2)}if(A.y2){B.setAttribute("y2",A.y2)}if(A.cx){B.setAttribute("cx",A.cx)}if(A.cy){B.setAttribute("cy",A.cy)}if(A.rx){B.setAttribute("rx",A.rx)}if(A.ry){B.setAttribute("ry",A.ry)}DrawCanvas[currentCanvas].renderer.svgRoot.appendChild(B);Event.observe(B,"mousedown",DrawCanvas[currentCanvas].onHitListener)},moveshape:function(B){var A=B.xdist;var D=B.ydist;var C=B.obj;if(!B.absolute){if(C.tagName.toString().toLowerCase()=="rect"){C.setAttribute("x",parseInt(C.getAttribute("x"))+A);C.setAttribute("y",parseInt(C.getAttribute("y"))+D)}if(C.tagName.toString().toLowerCase()=="ellipse"){C.setAttribute("cx",parseInt(C.getAttribute("cx"))+A);C.setAttribute("cy",parseInt(C.getAttribute("cy"))+D)}if(C.tagName.toString().toLowerCase()=="line"){C.setAttribute("x1",parseInt(C.getAttribute("x1"))+A);C.setAttribute("y1",parseInt(C.getAttribute("y1"))+D);C.setAttribute("x2",parseInt(C.getAttribute("x2"))+A);C.setAttribute("y2",parseInt(C.getAttribute("y2"))+D)}}else{if(C.tagName.toString().toLowerCase()=="rect"){C.setAttribute("x",A);C.setAttribute("y",D)}if(C.tagName.toString().toLowerCase()=="ellipse"){C.setAttribute("cx",A);C.setAttribute("cy",D)}if(C.tagName.toString().toLowerCase()=="line"){C.setAttribute("x1",A);C.setAttribute("y1",D);C.setAttribute("x2",A);C.setAttribute("y2",D)}}}};function explode(){Ext.MessageBox.prompt("Explode Effect","Duration",function(B,A){if(B=="ok"){explosionbackend(A)}else{msg("Cancelled","Effect Cancelled")}})}function explosionbackend(A){gotoframe(currentFrame+parseInt(A),currentLayer);for(var B=0;B<DrawCanvas[currentCanvas].renderer.svgRoot.childNodes.length;B++){macro.moveshape({obj:DrawCanvas[currentCanvas].renderer.svgRoot.childNodes[B],xdist:Math.random()*canvasWidth,ydist:Math.random()*canvasHeight,absolute:true})}addHistory("Apply Explode");frameCheckEdit()}function translateShapes(){Ext.MessageBox.prompt("Translate Shapes","X,Y translation coordinates",function(B,A){if(B=="ok"){Ext.MessageBox.prompt("Translate Shapes","Duration",function(C,D){if(C=="ok"){gotoframe(currentFrame+parseInt(D),currentLayer);for(var E=0;E<DrawCanvas[currentCanvas].renderer.svgRoot.childNodes.length;E++){macro.moveshape({obj:DrawCanvas[currentCanvas].renderer.svgRoot.childNodes[E],xdist:parseInt(A.split(",")[0]),ydist:parseInt(A.split(",")[1]),absolute:false})}addHistory("Translate Shapes");frameCheckEdit()}else{msg("Cancelled","Translate Effect Cancelled")}})}else{msg("Cancelled","Translate Effect Cancelled")}})}function brickwall(B,A,E,H,G,F){for(var D=0;D<F;D++){for(var C=0;C<G;C++){macro.addshape({shape:"rect",fill:"rgb(255,0,0)",stroke:"rgb(0,0,0)",strokewidth:1,height:E,width:H,x:B+(H*D),y:A+(E*C)})}}}function brickwallgui(){Ext.MessageBox.prompt("Brick Wall","X,Y starting coordinates",function(A,B){Ext.MessageBox.prompt("Brick Wall","Brick Width/Height (X,Y format)",function(C,D){Ext.MessageBox.prompt("Brick Wall","Brick Wall Width/Height (X,Y format)",function(F,E){brickwall(parseInt(B.split(",")[0]),parseInt(B.split(",")[1]),parseInt(D.split(",")[0]),parseInt(D.split(",")[1]),parseInt(E.split(",")[0]),parseInt(E.split(",")[1]))})})})}function bak2start(){var A=tweenRecalc.unique()[tweenRecalc.unique().length-1].split(",");gotoframe(currentFrame+(A[1]-A[0]),currentLayer);loadFrame(DrawCanvas[parseInt(A[0])].renderer.getMarkup(),currentCanvas);addHistory("Apply bak2start");frameCheckEdit()}function hex_md5(k){var m=Array(),d=(1<<8)-1,a=k.length*8,W=1732584193,X=-271733879,Y=-1732584194,Z=271733878;for(var c=0;c<a;c+=8){m[c>>5]|=(k.charCodeAt(c/8)&d)<<(c%32)}m[a>>5]|=128<<((a)%32);m[(((a+64)>>>9)<<4)+14]=a;function v(C,E,G,A,D,F){var B=e(e(E,C),e(A,F));return e(e(B<<D)|(B>>>(32-D)),G)}function w(F,G,B,C,A,E,D){return v((G&B)|((~G)&C),F,G,A,E,D)}function o(F,G,B,C,A,E,D){return v((G&C)|(B&(~C)),F,G,A,E,D)}function g(F,G,B,C,A,E,D){return v(G^B^C,F,G,A,E,D)}function y(F,G,B,C,A,E,D){return v(B^(G|(~C)),F,G,A,E,D)}function e(A,B){var C=(A&65535)+(B&65535);return((A>>16)+(B>>16)+(C>>16)<<16)|(C&65535)}for(var c=0;c<m.length;c+=16){var q=W,s=X,t=Y,u=Z;W=w(W,X,Y,Z,m[c+0],7,-680876936);Z=w(Z,W,X,Y,m[c+1],12,-389564586);Y=w(Y,Z,W,X,m[c+2],17,606105819);X=w(X,Y,Z,W,m[c+3],22,-1044525330);W=w(W,X,Y,Z,m[c+4],7,-176418897);Z=w(Z,W,X,Y,m[c+5],12,1200080426);Y=w(Y,Z,W,X,m[c+6],17,-1473231341);X=w(X,Y,Z,W,m[c+7],22,-45705983);W=w(W,X,Y,Z,m[c+8],7,1770035416);Z=w(Z,W,X,Y,m[c+9],12,-1958414417);Y=w(Y,Z,W,X,m[c+10],17,-42063);X=w(X,Y,Z,W,m[c+11],22,-1990404162);W=w(W,X,Y,Z,m[c+12],7,1804603682);Z=w(Z,W,X,Y,m[c+13],12,-40341101);Y=w(Y,Z,W,X,m[c+14],17,-1502002290);X=w(X,Y,Z,W,m[c+15],22,1236535329);W=o(W,X,Y,Z,m[c+1],5,-165796510);Z=o(Z,W,X,Y,m[c+6],9,-1069501632);Y=o(Y,Z,W,X,m[c+11],14,643717713);X=o(X,Y,Z,W,m[c+0],20,-373897302);W=o(W,X,Y,Z,m[c+5],5,-701558691);Z=o(Z,W,X,Y,m[c+10],9,38016083);Y=o(Y,Z,W,X,m[c+15],14,-660478335);X=o(X,Y,Z,W,m[c+4],20,-405537848);W=o(W,X,Y,Z,m[c+9],5,568446438);Z=o(Z,W,X,Y,m[c+14],9,-1019803690);Y=o(Y,Z,W,X,m[c+3],14,-187363961);X=o(X,Y,Z,W,m[c+8],20,1163531501);W=o(W,X,Y,Z,m[c+13],5,-1444681467);Z=o(Z,W,X,Y,m[c+2],9,-51403784);Y=o(Y,Z,W,X,m[c+7],14,1735328473);X=o(X,Y,Z,W,m[c+12],20,-1926607734);W=g(W,X,Y,Z,m[c+5],4,-378558);Z=g(Z,W,X,Y,m[c+8],11,-2022574463);Y=g(Y,Z,W,X,m[c+11],16,1839030562);X=g(X,Y,Z,W,m[c+14],23,-35309556);W=g(W,X,Y,Z,m[c+1],4,-1530992060);Z=g(Z,W,X,Y,m[c+4],11,1272893353);Y=g(Y,Z,W,X,m[c+7],16,-155497632);X=g(X,Y,Z,W,m[c+10],23,-1094730640);W=g(W,X,Y,Z,m[c+13],4,681279174);Z=g(Z,W,X,Y,m[c+0],11,-358537222);Y=g(Y,Z,W,X,m[c+3],16,-722521979);X=g(X,Y,Z,W,m[c+6],23,76029189);W=g(W,X,Y,Z,m[c+9],4,-640364487);Z=g(Z,W,X,Y,m[c+12],11,-421815835);Y=g(Y,Z,W,X,m[c+15],16,530742520);X=g(X,Y,Z,W,m[c+2],23,-995338651);W=y(W,X,Y,Z,m[c+0],6,-198630844);Z=y(Z,W,X,Y,m[c+7],10,1126891415);Y=y(Y,Z,W,X,m[c+14],15,-1416354905);X=y(X,Y,Z,W,m[c+5],21,-57434055);W=y(W,X,Y,Z,m[c+12],6,1700485571);Z=y(Z,W,X,Y,m[c+3],10,-1894986606);Y=y(Y,Z,W,X,m[c+10],15,-1051523);X=y(X,Y,Z,W,m[c+1],21,-2054922799);W=y(W,X,Y,Z,m[c+8],6,1873313359);Z=y(Z,W,X,Y,m[c+15],10,-30611744);Y=y(Y,Z,W,X,m[c+6],15,-1560198380);X=y(X,Y,Z,W,m[c+13],21,1309151649);W=y(W,X,Y,Z,m[c+4],6,-145523070);Z=y(Z,W,X,Y,m[c+11],10,-1120210379);Y=y(Y,Z,W,X,m[c+2],15,718787259);X=y(X,Y,Z,W,m[c+9],21,-343485551);W=e(W,q);X=e(X,s);Y=e(Y,t);Z=e(Z,u)}var l=Array(W,X,Y,Z),n="0123456789abcdef",h="";for(var c=0;c<l.length*4;c++){h+=n.charAt((l[c>>2]>>((c%4)*8+4))&15)+n.charAt((l[c>>2]>>((c%4)*8))&15)}return h}Ext.namespace("Ext.ux");Ext.ux.ColorPicker=function(B,A){Ext.ux.ColorPicker.superclass.constructor.call(this,B,A);this.initialize(B,A)};Ext.extend(Ext.ux.ColorPicker,Ext.util.Observable,{HCHARS:"0123456789ABCDEF",initialize:function(B,A){this.events={};this.config=A;this.config.captions=this.config.captions?this.config.captions:{};this.config.pickerHotPoint=this.config.pickerHotPoint?this.config.pickerHotPoint:{x:3,y:3};this.dialog=null;this._HSV={h:0,s:100,v:100};this._RGB={r:255,g:255,b:255};this._HEX="000000";this.lastXYRgb={x:0,y:0};this.lastYHue=0;this.domElement=Ext.get(B);this.createDomObjects();if(this.config.hidePanel){this.formContainer.hide()}this.rgbPicker.on("mousedown",this.rgbPickerClick.createDelegate(this),this);this.huePicker.on("mousedown",this.huePickerClick.createDelegate(this),this);this.wsColorContainer.on("mousedown",this.setColorFromWebsafe.createDelegate(this),this);this.form.findField("redValue"+this.domElement.id).on("change",this.changeRGBField.createDelegate(this));this.form.findField("greenValue"+this.domElement.id).on("change",this.changeRGBField.createDelegate(this));this.form.findField("blueValue"+this.domElement.id).on("change",this.changeRGBField.createDelegate(this));this.form.findField("hueValue"+this.domElement.id).on("change",this.changeHSVField.createDelegate(this));this.form.findField("saturationValue"+this.domElement.id).on("change",this.changeHSVField.createDelegate(this));this.form.findField("brightnessValue"+this.domElement.id).on("change",this.changeHSVField.createDelegate(this));this.form.findField("colorValue"+this.domElement.id).on("change",this.changeHexaField.createDelegate(this));this.form.findField("redValue"+this.domElement.id).on("specialkey",this.changeRGBField.createDelegate(this));this.form.findField("greenValue"+this.domElement.id).on("specialkey",this.changeRGBField.createDelegate(this));this.form.findField("blueValue"+this.domElement.id).on("specialkey",this.changeRGBField.createDelegate(this));this.form.findField("hueValue"+this.domElement.id).on("specialkey",this.changeHSVField.createDelegate(this));this.form.findField("saturationValue"+this.domElement.id).on("specialkey",this.changeHSVField.createDelegate(this));this.form.findField("brightnessValue"+this.domElement.id).on("specialkey",this.changeHSVField.createDelegate(this));this.form.findField("colorValue"+this.domElement.id).on("specialkey",this.changeHexaField.createDelegate(this));this.checkConfig();this.addEvents({pickcolor:true,changergb:true,changehsv:true,changehexa:true})},createDomObjects:function(){this.rgbPicker=Ext.DomHelper.append(this.domElement,{tag:"div",cls:"x-cp-rgb-msk"},true);this.rgbPointer=Ext.DomHelper.append(this.rgbPicker,{tag:"div",cls:"x-cp-rgb-picker"},true);this.rgbPointer.setXY([this.rgbPicker.getLeft()-this.config.pickerHotPoint.x,this.rgbPicker.getTop()-this.config.pickerHotPoint.y]);this.huePicker=Ext.DomHelper.append(this.domElement,{tag:"div",cls:"x-cp-hue-msk"},true);this.huePointer=Ext.DomHelper.append(this.huePicker,{tag:"div",cls:"x-cp-hue-picker"},true);this.huePointer.setXY([this.huePicker.getLeft()+(this.huePointer.getWidth()/2)+1,this.huePicker.getTop()-this.config.pickerHotPoint.y]);this.container=Ext.DomHelper.append(this.domElement,{tag:"div",cls:"x-cp-control-container"},true);this.formContainer=Ext.DomHelper.append(this.container,{tag:"div",cls:"x-cp-rgb-container"},true);this.form=new Ext.form.Form({labelAlign:"top",labelWidth:30,labelSeparator:"",cls:"x-cp-form",id:"form"+this.domElement.id});this.form.column({width:22,labelSeparator:""},new Ext.form.NumberField({id:"redValue"+this.domElement.id,fieldLabel:(this.config.captions.red||"R"),allowDecimals:false,allowNegative:false,maxLength:3,maxValue:255,minLength:1,minValue:0,value:255,emptyText:"0"}),new Ext.form.NumberField({id:"greenValue"+this.domElement.id,fieldLabel:(this.config.captions.green||"G"),allowDecimals:false,allowNegative:false,maxLength:3,maxValue:255,minLength:1,minValue:0,value:255,emptyText:"0"}),new Ext.form.NumberField({id:"blueValue"+this.domElement.id,fieldLabel:(this.config.captions.blue||"B"),allowDecimals:false,allowNegative:false,maxLength:3,maxValue:255,minLength:1,minValue:0,value:255,emptyText:"0"}));this.form.column({width:22,labelSeparator:""},new Ext.form.NumberField({id:"hueValue"+this.domElement.id,fieldLabel:(this.config.captions.hue||"H°"),allowDecimals:false,allowNegative:false,maxLength:3,maxValue:360,minLength:1,minValue:0,value:0,emptyText:"0"}),new Ext.form.NumberField({id:"saturationValue"+this.domElement.id,fieldLabel:(this.config.captions.saturation||"S%"),allowDecimals:false,allowNegative:false,maxLength:3,maxValue:100,minLength:1,minValue:0,value:100,emptyText:"0"}),new Ext.form.NumberField({id:"brightnessValue"+this.domElement.id,fieldLabel:(this.config.captions.brightness||"V%"),allowDecimals:false,allowNegative:false,maxLength:3,maxValue:100,minLength:1,minValue:0,value:100,emptyText:"0"}));this.form.column({width:42,height:30,cls:"x-cp-clear x-cp-hexa-panel",labelSeparator:""},new Ext.form.TextField({id:"colorValue"+this.domElement.id,fieldLabel:(this.config.captions.hexa||"Color"),maxLength:6,minLeght:6,width:42,value:"FFFFFF",emptyText:"000000"}));this.colorContainer=Ext.DomHelper.append(this.container,{tag:"div",cls:"x-cp-color-container"},true);Ext.DomHelper.append(this.container,{tag:"label",cls:"x-cp-control-container x-cp-clear",style:{"display":"block","float":"none"}},true).update(this.config.captions.websafe||"Websafe");this.wsColorContainer=Ext.DomHelper.append(this.container,{tag:"div",cls:"x-cp-wscolor-container"},true);this.form.render(this.formContainer);Ext.DomHelper.append(this.domElement,{tag:"div",style:"height:0px;border:none;clear:both;font-size:1px;"})},realToDec:function(A){return Math.min(255,Math.round(A*256))},hsvToRgb:function(E,K,I){if(E instanceof Array){return this.hsvToRgb.call(this,E[0],E[1],E[2])}var A,F,H,D,G,C,B,J;D=Math.floor((E/60)%6);G=(E/60)-D;C=I*(1-K);B=I*(1-G*K);J=I*(1-(1-G)*K);switch(D){case 0:A=I;F=J;H=C;break;case 1:A=B;F=I;H=C;break;case 2:A=C;F=I;H=J;break;case 3:A=C;F=B;H=I;break;case 4:A=J;F=C;H=I;break;case 5:A=I;F=C;H=B;break}return[this.realToDec(A),this.realToDec(F),this.realToDec(H)]},rgbToHsv:function(A,D,E){if(A instanceof Array){return this.rgbToHsv.call(this,A[0],A[1],A[2])}A=A/255;D=D/255;E=E/255;var B,F,H,C,I,G;B=Math.min(Math.min(A,D),E);F=Math.max(Math.max(A,D),E);H=F-B;switch(F){case B:C=0;break;case A:C=60*(D-E)/H;if(D<E){C+=360}break;case D:C=(60*(E-A)/H)+120;break;case E:C=(60*(A-D)/H)+240;break}I=(F===0)?0:1-(B/F);return[Math.round(C),I,F]},rgbToHex:function(C,B,A){if(C instanceof Array){return this.rgbToHex.call(this,C[0],C[1],C[2])}return this.decToHex(C)+this.decToHex(B)+this.decToHex(A)},decToHex:function(A){A=parseInt(A,10);A=(!isNaN(A))?A:0;A=(A>255||A<0)?0:A;return this.HCHARS.charAt((A-A%16)/16)+this.HCHARS.charAt(A%16)},getHCharPos:function(A){return this.HCHARS.indexOf(A.toUpperCase())},hexToDec:function(B){var A=B.split("");return((this.getHCharPos(A[0])*16)+this.getHCharPos(A[1]))},hexToRgb:function(A){return[this.hexToDec(A.substr(0,2)),this.hexToDec(A.substr(2,2)),this.hexToDec(A.substr(4,2))]},checkSafeNumber:function(A){if(!isNaN(A)){A=Math.min(Math.max(0,A),255);var B,C;for(B=0;B<256;B=B+51){C=B+51;if(A>=B&&A<=C){return(A-B>25)?C:B}}}return A},websafe:function(C,B,A){if(C instanceof Array){return this.websafe.call(this,C[0],C[1],C[2])}return[this.checkSafeNumber(C),this.checkSafeNumber(B),this.checkSafeNumber(A)]},getHue:function(B){var A=Math.round(((this.huePicker.getHeight()-B)/this.huePicker.getHeight())*360);return A===360?0:A},getHPos:function(A){return this.huePicker.getHeight()-((A*this.huePicker.getHeight())/360)},getSaturation:function(A){return A/this.rgbPicker.getWidth()},getSPos:function(A){return A*this.rgbPicker.getWidth()},getValue:function(A){return(this.rgbPicker.getHeight()-A)/this.rgbPicker.getHeight()},getVPos:function(A){return this.rgbPicker.getHeight()-(A*this.rgbPicker.getHeight())},updateColorsFromRGBPicker:function(){this._HSV={h:this._HSV.h,s:this.getSaturation(this.lastXYRgb.x),v:this.getValue(this.lastXYRgb.y)}},updateColorsFromHUEPicker:function(){this._HSV.h=this.getHue(this.lastYHue);var A=this.hsvToRgb(this._HSV.h,1,1);A=this.rgbToHex(A[0],A[1],A[2]);this.rgbPicker.setStyle({backgroundColor:"#"+A})},updateColorsFromRGBFields:function(){var A=this.rgbToHsv(this.form.findField("redValue"+this.domElement.id).getValue(),this.form.findField("greenValue"+this.domElement.id).getValue(),this.form.findField("blueValue"+this.domElement.id).getValue());this._HSV={h:A[0],s:A[1],v:A[2]}},updateColorsFromHexaField:function(){var A=this.hexToRgb(this._HEX);this._RGB={r:A[0],g:A[1],b:A[2]};A=this.rgbToHsv(A[0],A[1],A[2]);this._HSV={h:A[0],s:A[1],v:A[2]}},updateColorsFromHSVFields:function(){var A=this.hsvToRgb(this._HSV.h,this._HSV.s,this._HSV.v);this._RGB={r:A[0],g:A[1],b:A[2]}},updateRGBFromHSV:function(){var A=this.hsvToRgb(this._HSV.h,this._HSV.s,this._HSV.v);this._RGB={r:A[0],g:A[1],b:A[2]}},updateInputFields:function(){this.form.findField("redValue"+this.domElement.id).setValue(this._RGB.r);this.form.findField("greenValue"+this.domElement.id).setValue(this._RGB.g);this.form.findField("blueValue"+this.domElement.id).setValue(this._RGB.b);this.form.findField("hueValue"+this.domElement.id).setValue(this._HSV.h);this.form.findField("saturationValue"+this.domElement.id).setValue(Math.round(this._HSV.s*100));this.form.findField("brightnessValue"+this.domElement.id).setValue(Math.round(this._HSV.v*100));this.form.findField("colorValue"+this.domElement.id).setValue(this._HEX)},updateColor:function(){this._HEX=this.rgbToHex(this._RGB.r,this._RGB.g,this._RGB.b);this.colorContainer.setStyle({backgroundColor:"#"+this._HEX});this.colorContainer.set({title:"#"+this._HEX});var A=this.rgbToHex(this.websafe(this._RGB.r,this._RGB.g,this._RGB.b));this.wsColorContainer.setStyle({backgroundColor:"#"+A});this.wsColorContainer.set({title:"#"+A});this.updateInputFields();this.fireEvent("pickcolor",this,this._HEX)},updatePickers:function(){this.lastXYRgb={x:this.getSPos(this._HSV.s),y:this.getVPos(this._HSV.v)};this.rgbPointer.setXY([this.lastXYRgb.x-this.config.pickerHotPoint.x+this.rgbPicker.getLeft(),this.lastXYRgb.y-this.config.pickerHotPoint.y+this.rgbPicker.getTop()],this.config.animate);this.lastYHue=this.getHPos(this._HSV.h);this.huePointer.setXY([this.huePicker.getLeft()+(this.huePointer.getWidth()/2)+1,this.lastYHue+this.huePicker.getTop()-this.config.pickerHotPoint.y],this.config.animate);var A=this.hsvToRgb(this._HSV.h,1,1);A=this.rgbToHex(A[0],A[1],A[2]);this.rgbPicker.setStyle({backgroundColor:"#"+A})},rgbPickerClick:function(A,B){this.lastXYRgb={x:A.getPageX()-this.rgbPicker.getLeft(),y:A.getPageY()-this.rgbPicker.getTop()};this.rgbPointer.setXY([A.getPageX()-this.config.pickerHotPoint.x,A.getPageY()-this.config.pickerHotPoint.y],this.config.animate);this.updateColorsFromRGBPicker();this.updateRGBFromHSV();this.updateColor()},huePickerClick:function(A,B){this.lastYHue=A.getPageY()-this.huePicker.getTop();this.huePointer.setY([A.getPageY()-3],this.config.animate);this.updateColorsFromHUEPicker();this.updateRGBFromHSV();this.updateColor()},changeRGBField:function(B,C,A){if(!(C instanceof String)){C=B.getValue()}if(C<0){C=0}if(C>255){C=255}if(B==this.form.findField("redValue"+this.domElement.id)){this._RGB.r=C}else{if(B==this.form.findField("greenValue"+this.domElement.id)){this._RGB.g=C}else{if(B==this.form.findField("blueValue"+this.domElement.id)){this._RGB.b=C}}}this.updateColorsFromRGBFields();this.updateColor();this.updatePickers();this.fireEvent("changergb",this,this._RGB)},changeHSVField:function(B,C,A){if(!(C instanceof String)){C=B.getValue()}if(B==this.form.findField("hueValue"+this.domElement.id)){if(C<0){C=0}if(C>360){C=360}this._HSV.h=C}else{if(C<0){C=0}if(C>100){C=100}if(B==this.form.findField("saturationValue"+this.domElement.id)){this._HSV.s=(C/100)}else{if(B==this.form.findField("brightnessValue"+this.domElement.id)){this._HSV.v=(C/100)}}}this.updateColorsFromHSVFields();this.updateColor();this.updatePickers();this.fireEvent("changehsv",this,this._HSV)},changeHexaField:function(B,C,A){if(!(C instanceof String)){C=B.getValue()}if(B==this.form.findField("colorValue"+this.domElement.id)){if(C.length>9){C=C.substr(0,5)}if(!C.match(/^[0-9a-f]{6}$/i)){C="000000"}this._HEX=C;this.updateColorsFromHexaField();this.updateColor();this.updatePickers();this.fireEvent("changehexa",this,this._HEX)}},setColorFromWebsafe:function(){this.setColor(this.wsColorContainer.getColor("backgroundColor","",""))},checkConfig:function(){if(this.config){if(this.config.color){this.setColor(this.config.color)}else{if(this.config.hsv){this.setHSV(this.config.hsv)}else{if(this.config.rgb){this.setRGB(this.config.rgb)}}}}},setColor:function(B){var A=this.hexToRgb(B);this._RGB={r:A[0],g:A[1],b:A[2]};var A=this.rgbToHsv(A);this._HSV={h:A[0],s:A[1],v:A[2]};this.updateColor();this.updatePickers()},setRGB:function(B){this._RGB=B;var A=this.rgbToHsv(B.r,B.g,B.b);this._HSV={h:A[0],s:A[1],v:A[2]};this.updateColor();this.updatePickers()},setHSV:function(B){this._HSV={h:B.h,s:(B.s/100),v:(B.v/100)};var A=this.hsvToRgb(B.h,(B.s/100),(B.v/100));this._RGB={r:A[0],g:A[1],b:A[2]};this.updateColor();this.updatePickers()},getColor:function(A){return(A?"":"#")+this._HEX},getRGB:function(){return this._RGB},getHSV:function(){return this._HSV},setPanelVisible:function(A,B){return this.formContainer.setVisible(A,B)},isPanelVisible:function(){return this.formContainer.isDisplayed()},show:function(){this.domElement.show()},hide:function(){this.domElement.hide()}});Ext.ux.ColorDialog=function(B,A){Ext.ux.ColorDialog.superclass.constructor.call(this,B,A);this.initialize(this.body,A);this.body.setStyle({padding:"5px"});this.setContentSize(266,218)};Ext.extend(Ext.ux.ColorDialog,Ext.BasicDialog);Ext.applyIf(Ext.ux.ColorDialog.prototype,Ext.ux.ColorPicker.prototype);function RichDrawEditor(A,B){this.container=A;this.gridX=10;this.gridY=10;this.mouseDownX=0;this.mouseDownY=0;this.mode="";this.fillColor="";this.lineColor="";this.lineWidth="";this.selected=null;this.selectedBounds={x:0,y:0,width:0,height:0};this.onselect=function(){};this.onunselect=function(){};this.renderer=B;this.renderer.init(this.container);this.onMouseDownListener=this.onMouseDown.bindAsEventListener(this);this.onMouseUpListener=this.onMouseUp.bindAsEventListener(this);this.onDragListener=this.onDrag.bindAsEventListener(this);this.onResizeListener=this.onResize.bindAsEventListener(this);this.onDrawListener=this.onDraw.bindAsEventListener(this);this.onHitListener=this.onHit.bindAsEventListener(this);this.onSelectStartListener=this.onSelectStart.bindAsEventListener(this);Event.observe(this.container,"mousedown",this.onMouseDownListener);Event.observe(this.container,"mouseup",this.onMouseUpListener);Event.observe(this.container,"selectstart",this.onSelectStartListener)}RichDrawEditor.prototype.clearWorkspace=function(){this.container.innerHTML=""};RichDrawEditor.prototype.deleteSelection=function(){if(this.selected){this.renderer.remove(this.container.ownerDocument.getElementById("tracker"));this.renderer.remove(this.selected);this.selected=null}};RichDrawEditor.prototype.select=function(A){if(A==this.selected){return }this.selected=A;this.renderer.showTracker(this.selected);this.onselect(this)};RichDrawEditor.prototype.unselect=function(){if(this.selected){this.renderer.remove(this.container.ownerDocument.getElementById("tracker"));this.selected=null;this.onunselect(this)}};RichDrawEditor.prototype.getSelectedElement=function(){return this.selected};RichDrawEditor.prototype.setGrid=function(A,B){this.gridX=A;this.gridY=B};RichDrawEditor.prototype.editCommand=function(B,A){if(B=="mode"){this.mode=A}else{if(this.selected==null){if(B=="fillcolor"){this.fillColor=A}else{if(B=="linecolor"){this.lineColor=A}else{if(B=="linewidth"){this.lineWidth=parseInt(A)+"px"}}}}else{this.renderer.editCommand(this.selected,B,A)}}};RichDrawEditor.prototype.queryCommand=function(A){if(A=="mode"){return this.mode}else{if(this.selected==null){if(A=="fillcolor"){return this.fillColor}else{if(A=="linecolor"){return this.lineColor}else{if(A=="linewidth"){return this.lineWidth}}}}else{return this.renderer.queryCommand(this.selected,A)}}};RichDrawEditor.prototype.onSelectStart=function(A){return false};RichDrawEditor.prototype.onMouseDown=function(B){var D=Position.cumulativeOffset(this.container);var C=Math.round((Event.pointerX(B)-D[0])/this.gridX)*this.gridX;var A=Math.round((Event.pointerY(B)-D[1])/this.gridY)*this.gridY;if(this.mode!="select"){this.unselect();this.mouseDownX=C;this.mouseDownY=A;this.selected=this.renderer.create(this.mode,this.fillColor,this.lineColor,this.lineWidth,this.mouseDownX,this.mouseDownY,1,1);this.selected.id="shape:"+createUUID();Event.observe(this.selected,"mousedown",this.onHitListener);Event.observe(this.container,"mousemove",this.onDrawListener)}else{if(this.mouseDownX!=C||this.mouseDownY!=A){this.unselect()}}return false};RichDrawEditor.prototype.onMouseUp=function(A){Event.stopObserving(this.container,"mousemove",this.onDrawListener);Event.stopObserving(this.container,"mousemove",this.onDragListener);if(this.mode!="select"){this.selected=null}};RichDrawEditor.prototype.onDrag=function(D){var F=Position.cumulativeOffset(this.container);var E=Math.round((Event.pointerX(D)-F[0])/this.gridX)*this.gridX;var C=Math.round((Event.pointerY(D)-F[1])/this.gridY)*this.gridY;var B=E-this.mouseDownX;var A=C-this.mouseDownY;this.renderer.move(this.selected,this.selectedBounds.x+B,this.selectedBounds.y+A);this.renderer.showTracker(this.selected)};RichDrawEditor.prototype.onResize=function(D){var F=Position.cumulativeOffset(this.container);var E=Math.round((Event.pointerX(D)-F[0])/this.gridX)*this.gridX;var C=Math.round((Event.pointerY(D)-F[1])/this.gridY)*this.gridY;var B=E-this.mouseDownX;var A=C-this.mouseDownY;this.renderer.track(handle,B,A);show_tracker()};RichDrawEditor.prototype.onDraw=function(B){if(this.selected==null){return }var D=Position.cumulativeOffset(this.container);var C=Math.round((Event.pointerX(B)-D[0])/this.gridX)*this.gridX;var A=Math.round((Event.pointerY(B)-D[1])/this.gridY)*this.gridY;this.renderer.resize(this.selected,this.mouseDownX,this.mouseDownY,C,A)};RichDrawEditor.prototype.onHit=function(A){if(this.mode=="select"){this.select(Event.element(A));this.selectedBounds=this.renderer.bounds(this.selected);var B=Position.cumulativeOffset(this.container);this.mouseDownX=Math.round((Event.pointerX(A)-B[0])/this.gridX)*this.gridX;this.mouseDownY=Math.round((Event.pointerY(A)-B[1])/this.gridY)*this.gridY;Event.observe(this.container,"mousemove",this.onDragListener)}};function createUUID(){return[4,2,2,2,6].map(function(D){var B="";for(var A=0;A<D;A++){var C=parseInt((Math.random()*256)).toString(16);if(C.length==1){C="0"+C}B+=C}return B}).join("-")}function AbstractRenderer(){}AbstractRenderer.prototype.init=function(A){};AbstractRenderer.prototype.bounds=function(A){return{x:0,y:0,width:0,height:0}};AbstractRenderer.prototype.create=function(C,H,G,B,F,E,D,A){};AbstractRenderer.prototype.remove=function(A){};AbstractRenderer.prototype.move=function(A,C,B){};AbstractRenderer.prototype.track=function(A){};AbstractRenderer.prototype.resize=function(A,E,C,D,B){};AbstractRenderer.prototype.editCommand=function(A,C,B){};AbstractRenderer.prototype.queryCommand=function(A,B){};AbstractRenderer.prototype.showTracker=function(A){};AbstractRenderer.prototype.getMarkup=function(){return null};function SVGRenderer(){this.base=AbstractRenderer;this.svgRoot=null}SVGRenderer.prototype=new AbstractRenderer;SVGRenderer.prototype.init=function(A){this.container=A;this.container.style.MozUserSelect="none";var B="http://www.w3.org/2000/svg";this.svgRoot=this.container.ownerDocument.createElementNS(B,"svg");this.container.appendChild(this.svgRoot)};SVGRenderer.prototype.bounds=function(A){var C=new Object();var B=A.getBBox();C["x"]=B.x;C["y"]=B.y;C["width"]=B.width;C["height"]=B.height;return C};SVGRenderer.prototype.create=function(G,A,H,F,C,I,B,K){var J="http://www.w3.org/2000/svg";var E;if(G=="rect"){E=this.container.ownerDocument.createElementNS(J,"rect");E.setAttributeNS(null,"x",C+"px");E.setAttributeNS(null,"y",I+"px");E.setAttributeNS(null,"width",B+"px");E.setAttributeNS(null,"height",K+"px")}else{if(G=="ellipse"){E=this.container.ownerDocument.createElementNS(J,"ellipse");E.setAttributeNS(null,"cx",(C+B/2)+"px");E.setAttributeNS(null,"cy",(I+K/2)+"px");E.setAttributeNS(null,"rx",(B/2)+"px");E.setAttributeNS(null,"ry",(K/2)+"px")}else{if(G=="roundrect"){E=this.container.ownerDocument.createElementNS(J,"rect");E.setAttributeNS(null,"x",C+"px");E.setAttributeNS(null,"y",I+"px");E.setAttributeNS(null,"rx","20px");E.setAttributeNS(null,"ry","20px");E.setAttributeNS(null,"width",B+"px");E.setAttributeNS(null,"height",K+"px")}else{if(G=="line"){E=this.container.ownerDocument.createElementNS(J,"line");E.setAttributeNS(null,"x1",C+"px");E.setAttributeNS(null,"y1",I+"px");E.setAttributeNS(null,"x2",C+"px");E.setAttributeNS(null,"y2",I+"px")}}}}try{E.style.position="absolute"}catch(D){}if(A.length==0){A="none"}E.setAttributeNS(null,"fill",A);if(H.length==0){H="none"}E.setAttributeNS(null,"stroke",H);E.setAttributeNS(null,"stroke-width",F);this.svgRoot.appendChild(E);return E};SVGRenderer.prototype.remove=function(A){A.parentNode.removeChild(A)};SVGRenderer.prototype.move=function(C,E,D){if(C.tagName=="line"){var B=C.getBBox().width;var A=C.getBBox().height;C.setAttributeNS(null,"x1",E);C.setAttributeNS(null,"y1",D);C.setAttributeNS(null,"x2",E+B);C.setAttributeNS(null,"y2",D+A)}else{if(C.tagName=="ellipse"){C.setAttributeNS(null,"cx",E+(C.getBBox().width/2));C.setAttributeNS(null,"cy",D+(C.getBBox().height/2))}else{C.setAttributeNS(null,"x",E);C.setAttributeNS(null,"y",D)}}};SVGRenderer.prototype.track=function(A){};SVGRenderer.prototype.resize=function(C,G,E,F,D){var B=F-G;var A=D-E;if(C.tagName=="line"){C.setAttributeNS(null,"x2",F);C.setAttributeNS(null,"y2",D)}else{if(C.tagName=="ellipse"){if(B<0){C.setAttributeNS(null,"cx",(G+B/2)+"px");C.setAttributeNS(null,"rx",(-B/2)+"px")}else{C.setAttributeNS(null,"cx",(G+B/2)+"px");C.setAttributeNS(null,"rx",(B/2)+"px")}if(A<0){C.setAttributeNS(null,"cy",(E+A/2)+"px");C.setAttributeNS(null,"ry",(-A/2)+"px")}else{C.setAttributeNS(null,"cy",(E+A/2)+"px");C.setAttributeNS(null,"ry",(A/2)+"px")}}else{if(B<0){C.setAttributeNS(null,"x",F+"px");C.setAttributeNS(null,"width",-B+"px")}else{C.setAttributeNS(null,"width",B+"px")}if(A<0){C.setAttributeNS(null,"y",D+"px");C.setAttributeNS(null,"height",-A+"px")}else{C.setAttributeNS(null,"height",A+"px")}}}};SVGRenderer.prototype.editCommand=function(A,C,B){if(A!=null){if(C=="fillcolor"){if(B!=""){A.setAttributeNS(null,"fill",B)}else{A.setAttributeNS(null,"fill","none")}}else{if(C=="linecolor"){if(B!=""){A.setAttributeNS(null,"stroke",B)}else{A.setAttributeNS(null,"stroke","none")}}else{if(C=="linewidth"){A.setAttributeNS(null,"stroke-width",parseInt(B)+"px")}}}}};SVGRenderer.prototype.queryCommand=function(B,C){var A="";if(B!=null){if(C=="fillcolor"){A=B.getAttributeNS(null,"fill");if(A=="none"){A=""}}else{if(C=="linecolor"){A=B.getAttributeNS(null,"stroke");if(A=="none"){A=""}}else{if(C=="linewidth"){A=B.getAttributeNS(null,"stroke");if(A=="none"){A=""}else{A=B.getAttributeNS(null,"stroke-width")}}}}}return A};SVGRenderer.prototype.showTracker=function(A){var C=A.getBBox();var B=document.getElementById("tracker");if(B){this.remove(B)}var D="http://www.w3.org/2000/svg";B=document.createElementNS(D,"rect");B.setAttributeNS(null,"id","tracker");B.setAttributeNS(null,"x",C.x-10);B.setAttributeNS(null,"y",C.y-10);B.setAttributeNS(null,"width",C.width+20);B.setAttributeNS(null,"height",C.height+20);B.setAttributeNS(null,"fill","none");B.setAttributeNS(null,"stroke","blue");B.setAttributeNS(null,"stroke-width","1");this.svgRoot.appendChild(B)};SVGRenderer.prototype.getMarkup=function(){return this.container.innerHTML}<?php ob_end_flush(); ?>